Try Ruby is a interactive shell that quickly and whimsically teaches the Ruby programming language. Originally _why's idea, it has been recreated from the ground up by Rubyists who have a passion for Ruby and for teaching their fellow (wo)man how to program.
poem.lines.to_a.reverse
=> ["More still did I want to eat it.
", "Planting our flag on Halley's comet,
", "But when I saw it on television,
", "And my toast has gone to the moon.
", "My honeydew has flown from my hand
"]
Success!
Notice there is honeydew and toast above.
print poem.lines.to_a.reverse.join
More still did I want to eat it.
Planting our flag on Halley's comet,
But when I saw it on television,
And my honeydew has gone to the moon.
My honeydew has flown from my hand
Success!
Notice there are now two honeydew and no toast.
To get to the other side?