The Twelve Days of Christmas: Difference between revisions
Content added Content deleted
m (→{{header|Smart BASIC}}: fixed </Lang> tag) |
(+add Pike) |
||
Line 3,933: | Line 3,933: | ||
(bye)</lang> |
(bye)</lang> |
||
=={{header|Pike}}== |
|||
<lang Pike>int main() { |
|||
array(string) days = ({"first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth"}); |
|||
array(string) gifts = ({"A partridge in a pear tree.", "Two turtle doves and", "Three french hens", "Four calling birds", "Five golden 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"}); |
|||
for (int i = 0; i < 12; i++) { |
|||
write("On the " + (string)days[i] + " day of Christmas\n"); |
|||
write("My true love gave to me:\n"); |
|||
for (int j = 0; j < i + 1; j++) { |
|||
write((string)gifts[i - j] + "\n"); |
|||
} |
|||
if (i != 11) { |
|||
write("\n"); |
|||
} |
|||
} |
|||
return 0; |
|||
}</lang> |
|||
{{out}} |
|||
<pre>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 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 golden rings |
|||
Four calling birds |
|||
Three french hens |
|||
Two turtle doves and |
|||
A partridge in a pear tree.</pre> |
|||
=={{header|PowerShell}}== |
=={{header|PowerShell}}== |