Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created November 22, 2014 18:08
Show Gist options
  • Save AJFaraday/9f4cb666a9abbb4d8e05 to your computer and use it in GitHub Desktop.
Save AJFaraday/9f4cb666a9abbb4d8e05 to your computer and use it in GitHub Desktop.
12days.rb
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