|
| 1 | +import "twelve_days" |
| 2 | + |
| 3 | +-- first day a partridge in a pear tree |
| 4 | +-- == |
| 5 | +-- input { 1 1 } |
| 6 | +-- output { "On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.\n" } |
| 7 | + |
| 8 | +-- second day two turtle doves |
| 9 | +-- == |
| 10 | +-- input { 2 2 } |
| 11 | +-- output { "On the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.\n" } |
| 12 | + |
| 13 | +-- third day three french hens |
| 14 | +-- == |
| 15 | +-- input { 3 3 } |
| 16 | +-- output { "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.\n" } |
| 17 | + |
| 18 | +-- fourth day four calling birds |
| 19 | +-- == |
| 20 | +-- input { 4 4 } |
| 21 | +-- output { "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.\n" } |
| 22 | + |
| 23 | +-- fifth day five gold rings |
| 24 | +-- == |
| 25 | +-- input { 5 5 } |
| 26 | +-- output { "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.\n" } |
| 27 | + |
| 28 | +-- sixth day six geese-a-laying |
| 29 | +-- == |
| 30 | +-- input { 6 6 } |
| 31 | +-- output { "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.\n" } |
| 32 | + |
| 33 | +-- seventh day seven swans-a-swimming |
| 34 | +-- == |
| 35 | +-- input { 7 7 } |
| 36 | +-- output { "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.\n" } |
| 37 | + |
| 38 | +-- eighth day eight maids-a-milking |
| 39 | +-- == |
| 40 | +-- input { 8 8 } |
| 41 | +-- output { "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.\n" } |
| 42 | + |
| 43 | +-- ninth day nine ladies dancing |
| 44 | +-- == |
| 45 | +-- input { 9 9 } |
| 46 | +-- output { "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.\n" } |
| 47 | + |
| 48 | +-- tenth day ten lords-a-leaping |
| 49 | +-- == |
| 50 | +-- input { 10 10 } |
| 51 | +-- output { "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.\n" } |
| 52 | + |
| 53 | +-- eleventh day eleven pipers piping |
| 54 | +-- == |
| 55 | +-- input { 11 11 } |
| 56 | +-- output { "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.\n" } |
| 57 | + |
| 58 | +-- twelfth day twelve drummers drumming |
| 59 | +-- == |
| 60 | +-- input { 12 12 } |
| 61 | +-- output { "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.\n" } |
| 62 | + |
| 63 | +-- recites first three verses of the song |
| 64 | +-- == |
| 65 | +-- input { 1 3 } |
| 66 | +-- output { "On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.\nOn the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.\nOn the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n" } |
| 67 | + |
| 68 | +-- recites three verses from the middle of the song |
| 69 | +-- == |
| 70 | +-- input { 4 6 } |
| 71 | +-- output { "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.\nOn 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.\nOn 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.\n" } |
| 72 | + |
| 73 | +-- recites the whole song |
| 74 | +-- == |
| 75 | +-- input { 1 12 } |
| 76 | +-- output { "On the first day of Christmas my true love gave to me: a Partridge in a Pear Tree.\nOn the second day of Christmas my true love gave to me: two Turtle Doves, and a Partridge in a Pear Tree.\nOn the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\nOn 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.\nOn 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.\nOn 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.\nOn 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.\nOn 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.\nOn 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.\nOn 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.\nOn 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.\nOn 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.\n" } |
| 77 | + |
| 78 | +let main (start_verse: i32) (end_verse: i32): []u8 = |
| 79 | + recite start_verse end_verse |
0 commit comments