The Twelve Days of Christmas: Difference between revisions

Content added Content deleted
(Add CLU)
(Added solution for Action!)
Line 177: Line 177:
.tab: dw .n1,.n2,.n3,.n4,.n5,.n6
.tab: dw .n1,.n2,.n3,.n4,.n5,.n6
dw .n7,.n8,.n9,.n10,.n11,.n12</lang>
dw .n7,.n8,.n9,.n10,.n11,.n12</lang>

=={{header|Action!}}==
<lang Action!>PROC Wait(BYTE frames)
BYTE RTCLOK=$14
frames==+RTCLOK
WHILE frames#RTCLOK DO OD
RETURN

PROC Main()
DEFINE PTR="CARD"
PTR ARRAY num(12),obj(12)
BYTE i,j

num(0)="first" num(1)="second" num(2)="third"
num(3)="fourth" num(4)="fifth" num(5)="sixth"
num(6)="seventh" num(7)="eight" num(8)="ninth"
num(9)="tenth" num(10)="eleventh" num(11)="Twelfth"

obj(0)="And a partridge in a pear tree."
obj(1)="Two turtle doves"
obj(2)="Three french hens"
obj(3)="Four calling birds"
obj(4)="Five golden rings"
obj(5)="Six geese a-laying"
obj(6)="Seven swans a-swimming"
obj(7)="Eight maids a-milking"
obj(8)="Nine ladies dancing"
obj(9)="Ten lords a-leaping"
obj(10)="Eleven pipers piping"
obj(11)="Twelve drummers drumming"

FOR i=0 TO 11
DO
PrintF("On the %S day of Christmas,%E",num(i))
PrintE("My true love gave to me:")
IF i=0 THEN
PrintE("A partridge in a pear tree.")
ELSE
j=i+1
WHILE j>0
DO
j==-1
PrintE(obj(j))
OD
FI
PutE()
Wait(50)
OD
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/The_Twelve_Days_of_Christmas.png Screenshot from Atari 8-bit computer]
<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|ActionScript}}==
=={{header|ActionScript}}==