I recently fell in love with programming riddles and was told that
they’re the best way to learn a language. I agree with this statement
because a good riddle challenges you to think outside the box, and
that’s a great skill to have when programming. Plus getting too cozy
can lead to flawed and automated code because you forget WHY it worked
before and didn’t think about why it wouldn’t work here.
So: Ruby programming riddles . . . I must admit I didn’t start this
discussion because I know any.
But just to get the ball rolling:
Print 1…100 on the screen in 4 or less lines of code.
(And note that I will consider these by the most lines you can make
out of your answer so writing it all on one line is useless.)
I know it’s not the hardest, but it’s just to get the ball rolling.
I’m betting this isn’t even the right place to make this thread.