12 days of christmas

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Print 12 days of christmas (what's the input?)

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

for(var d=1,g="",i;d<=12;d++){g+=("On the "+["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth"][d-1]+" day of Christmas my true love gave to me: ");for(i=d;i>0;i--)g+=["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 Gold Rings, ","four Calling Birds, ","three French Hens, ","two Turtle Doves, ","a Partridge in a Pear Tree."][12-i]+(i==1?"":i==2?" and ":"");print(g);g=""}

Sample output:

On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.
On the second day of Christmas my true love gave to me: two Turtle Doves,  and a Partridge in a Pear Tree.
On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the eleventh day of Christmas my true love gave 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 Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.
On the twelfth day of Christmas my true love gave 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 Gold Rings, four Calling Birds, three French Hens, two Turtle Doves,  and a Partridge in a Pear Tree.

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1rotary-o780.01782026/07/30 00:00:500B / 40B / 37B

Ruby2 _

RankUserSizeTimeDateStatistics
1rotary-o780.05962026/07/30 00:00:370B / 40B / 37B

Perl _

RankUserSizeTimeDateStatistics
1tails890.01662026/07/27 02:52:040B / 19B / 69B

Python _

RankUserSizeTimeDateStatistics
1hallvabo1070.03282026/07/31 07:55:270B / 54B / 45B

Python3 _

RankUserSizeTimeDateStatistics
1hallvabo1050.04742026/07/31 07:57:280B / 51B / 46B

JavaScript _

RankUserSizeTimeDateStatistics
1JOrE20160.02172026/07/27 01:29:560B / ?B / ?B
2#c0ffee160.02002026/07/27 07:38:010B / 12B / 4B
3#c0ffee()4600.02132026/07/27 07:56:340B / 332B / 100B

Java _

RankUserSizeTimeDateStatistics
1rotary-o1800.06612026/08/09 17:18:080B / 106B / 69B

C# _

RankUserSizeTimeDateStatistics
1rotary-o1690.03842026/08/09 17:18:220B / 103B / 59B

sed _

RankUserSizeTimeDateStatistics
1McBusLuck1420.01562026/07/27 18:46:140B / 39B / 78B

Bash _

RankUserSizeTimeDateStatistics
1JOrE2040.01162026/07/27 01:31:140B / ?B / ?B
2#c0ffee40.01272026/07/27 07:53:450B / 4B / 0B
3McBusLuck40.02142026/07/27 17:54:190B / 4B / 0B

Zsh _

RankUserSizeTimeDateStatistics
1McBusLuck40.02422026/07/27 17:54:270B / 4B / 0B

Fish _

RankUserSizeTimeDateStatistics
1McBusLuck40.04782026/07/27 17:54:320B / 4B / 0B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o1222.90332026/08/09 17:04:550B / 64B / 55B

Language Ranking_

RankLangUserSizeScore
1BashJOrE20410000
2ZshMcBusLuck410000
3FishMcBusLuck410000
4JavaScriptJOrE20162500
5Ruby2rotary-o78512
6Rubyrotary-o78512
7Perltails89449
8Python3hallvabo105380
9Pythonhallvabo107373
10Scalarotary-o122327
11sedMcBusLuck142281
12C#rotary-o169236
13Javarotary-o180222

return to the top page