#!/usr/bin/ruby
days = ["first", "second", "third", "fourth", "fifth", "sixth",
"seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth"]
numbers = [ "a", "two", "three", "four", "five", "six", \
"seven", "eight", "nine", "ten", "eleven", "twelve" ]
gifts = [ "partridge in a pear tree", \
"turtle doves", "French hens", "calling birds", \
"golden rings", "geese a-laying", "swans a-swimming", \
"maids a-milking", "ladies dancing", "lords a-leaping", \
"pipers piping", "drummers drumming" ]
days.length.times { |i|
puts "On the " + days[i] + " of Christmas,"
puts "my true love sent to me,\n"
i.downto(0) {|j|
if (j == 0) & ( i != 0 )
andy = "and "
else
andy = ""
end
puts andy + numbers[j] + " " + gifts[j] + "\n"
}
puts "\n"
}
Lo que resulta en :
On the first of Christmas,
my true love sent to me,
a partridge in a pear tree
On the second of Christmas,
my true love sent to me,
two turtle doves
and a partridge in a pear tree
On the third of Christmas,
my true love sent to me,
three French hens
two turtle doves
and a partridge in a pear tree
On the fourth of Christmas,
my true love sent to me,
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the fifth of Christmas,
my true love sent to me,
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the sixth of Christmas,
my true love sent to me,
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the seventh of Christmas,
my true love sent to me,
seven swans a-swimming
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the eighth of Christmas,
my true love sent to me,
eight maids a-milking
seven swans a-swimming
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the ninth of Christmas,
my true love sent to me,
nine ladies dancing
eight maids a-milking
seven swans a-swimming
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the tenth of Christmas,
my true love sent to me,
ten lords a-leaping
nine ladies dancing
eight maids a-milking
seven swans a-swimming
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the eleventh of Christmas,
my true love sent to me,
eleven pipers piping
ten lords a-leaping
nine ladies dancing
eight maids a-milking
seven swans a-swimming
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
On the twelfth of Christmas,
my true love sent to me,
twelve drummers drumming
eleven pipers piping
ten lords a-leaping
nine ladies dancing
eight maids a-milking
seven swans a-swimming
six geese a-laying
five golden rings
four calling birds
three French hens
two turtle doves
and a partridge in a pear tree
No comments:
Post a Comment