Anonymous user
The Twelve Days of Christmas: Difference between revisions
add Perl 6 entry, fix extra newlines in other examples
m (make a draft task for now) |
(add Perl 6 entry, fix extra newlines in other examples) |
||
Line 8:
{{works with|Flash Player|Flash Player|10}}
{{works with|Adobe AIR|AIR|1.5}} (Although the code can work in Flash Player 9 by replacing the Vectors with Arrays)
<lang ActionScript>package {
import flash.display.Sprite;
Line 121 ⟶ 120:
}
}</lang>▼
▲</lang>
=={{header|C sharp|C#}}==
<lang csharp>using System;
public class TwelveDaysOfChristmas {
Line 169 ⟶ 166:
}
}</lang>▼
=={{header|Perl 6}}==
▲</lang>
<lang perl6>my @days = <first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth>;
my @gifts = lines q:to//;
And a partridge in a pear tree.
Two turtle doves,
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,
sub nth($n) { say "On the @days[$n] day of Christmas, my true love gave to me:" }
nth(0); say @gifts[0].subst('nd a','');
for 1 ... 11 -> $d {
say '';
nth($d);
say @gifts[$_] for $d ... 0;
}</lang>
|