Created
September 28, 2014 22:02
-
-
Save hepplerj/c626e0e26d37c08363c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby example | |
reverse_lines = File.open("poem.txt").readlines.reverse | |
# p reverse_lines | |
reverse_lines.each do |line| | |
words = line.split.reverse | |
puts words.join(" ") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
O CAPTAIN! my Captain! our fearful trip is done; | |
The ship has weather'd every rack, the prize we sought is won; | |
The port is near, the bells I hear, the people all exulting, | |
While follow eyes the steady keel, the vessel grim and daring: | |
But O heart! heart! heart! | |
O the bleeding drops of red, | |
Where on the deck my Captain lies, | |
Fallen cold and dead. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment