Created
November 22, 2014 18:08
-
-
Save AJFaraday/9f4cb666a9abbb4d8e05 to your computer and use it in GitHub Desktop.
12days.rb
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
days = [ | |
'first','second','third','fourth','fifth','sixth', | |
'seventh','eighth','nineth','tenth','eleventh','twelveth' | |
] | |
gifts = [ | |
'a partridge in a pear tree', 'two turtle doves and','three french hens', | |
'four calling birds', 'five gold rings', 'six geese a laying', | |
'seven swans a swimming', 'eight maids a milking', 'nine ladies dancing', | |
'ten lords a leaping', 'eleven pipers piping', 'twelve drummers drumming' | |
] | |
days.each_with_index do |day, i| | |
puts "\nOn the #{day} day of Christmas" | |
puts "my true love gave to me" | |
gifts[0..i].reverse.each{|gift|puts gift}; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment