Skip to main content

Timeline for 12 Days of Christmas Lyrics

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
May 5, 2022 at 22:14 comment added DaCuteRaccoon @WayneConrad Also sorry for the short message, I had to delete about 200 characters because I went over the limit.
May 5, 2022 at 22:11 comment added Wayne Conrad @DaCuteRaccoon Huh. I don't get what I meant either.
May 5, 2022 at 21:31 comment added DaCuteRaccoon @WayneConrad just made a new version with your edits. I didn't get what you meant to "get rid of the reverse by reversing." 12.times{|i|puts"On the #{"First^Second^Third^Fourth^Fifth^Sixth^Seventh^Eighth^Ninth^Tenth^Eleventh^Twelfth".split("^")[i]} day of Christmas\nMy true love sent to me","A Partridge in a Pear Tree.\n\n^Two Turtle Doves, and^Three French Hens,^Four Calling Birds,^Five Gold Rings,^Six Geese-a-Lay*Seven Swans-a-Swimm*Eight Maids-a-Milk*Nine Ladies Danc*Ten Lords-a-Leap*Eleven Pipers Pip*Twelve Drummers Drumm*".gsub('*','ing,^').split('^')[0..i].reverse.join("\n")}
Oct 24, 2014 at 15:40 comment added undergroundmonorail couldn't you change "drumming" to "drumm*"?
Jan 5, 2014 at 18:41 comment added Wayne Conrad I like your trick with * to represent "ing". You should be able to get it down to about 440 by: use 12.times instead of (0..11).each; do a single puts with two arguments instead of two puts with one argument; use %w() notation for the days-of-Christmas array. Finally, you can get rid of the reverse by reversing the list, adding an extra ^ to the end of the string, and then using [-i..-1] instead of [0..i].
Dec 8, 2011 at 12:52 history answered kev CC BY-SA 3.0