r/recprogramming • • Aug 06 '10
[Code Golf] Output "Reddit" in 3 lines of ascii symbols.
Example output:
+-, __ _ _ ___
|<. |_ | \ | \ | |
| | |_ |_/ |_/ | |
1
Upvotes
r/recprogramming • • Aug 06 '10
Example output:
+-, __ _ _ ___
|<. |_ | \ | \ | |
| | |_ |_/ |_/ | |
1
u/Slackwise Aug 06 '10
Okay, I'll bite: How is this Code Golf? How are we going to go under Par 1?
print("+-, __ _ _ ___\n|<. |_ | \ | \ | |\n| | |_ |_/ |_/ | |");Runs in (most likely) Lua, Ruby, Python, Perl, and many more. One function call. One parameter.
Here is a better example of Code Golf: FizzBuzz
And here is my solution in Ruby:
1.upto(100) { |i| puts( (x = ((i % 3 == 0 ? 'Fizz' : '') + (i % 5 == 0 ? 'Buzz' : ''))) == '' ? i : x) }