The Twelve Days of Christmas: Difference between revisions

moved BASIC256, True BASIC and Yabasic to section BASIC
(Added various BASIC dialects (Applesoft BASIC, Chipmunk Basic, GW-BASIC, MSX Basic, QuiteBASIC and XBasic))
(moved BASIC256, True BASIC and Yabasic to section BASIC)
Line 983:
==={{header|Applesoft BASIC}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|BASIC256}}===
<syntaxhighlight lang="qbasic">dim dia$ = {"first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth"}
 
dim gift$ = {"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 i = 0 to 11
print "On the "; dia$[i]; " dia of Christmas,"
print "My true love gave to me:"
for j = i to 1 step -1
print gift$[j]
next j
print
next i</syntaxhighlight>
 
==={{header|Chipmunk Basic}}===
Line 1,029 ⟶ 1,043:
==={{header|Quite BASIC}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|True BASIC}}===
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
<syntaxhighlight lang="qbasic">DATA "first","second","third","fourth","fifth","sixth"
DATA "seventh","eighth","ninth","tenth","eleventh","twelfth"
DATA "A partridge in a pear tree."
DATA "Two turtle doves and"
DATA "Three french hens"
DATA "Four calling birds"
DATA "Five golden rings"
DATA "Six geese a-laying"
DATA "Seven swans a-swimming"
DATA "Eight maids a-milking"
DATA "Nine ladies dancing"
DATA "Ten lords a-leaping"
DATA "Eleven pipers piping"
DATA "Twelve drummers drumming"
 
DIM day$(12), gift$(12)
FOR i = 1 TO 12
READ day$(i)
NEXT i
FOR i = 1 TO 12
READ gift$(i)
NEXT i
 
FOR i = 1 TO 12
PRINT "On the "; day$(i); " day of Christmas,"
PRINT "My true love gave TO me:"
FOR j = i TO 1 STEP -1
PRINT gift$(j)
NEXT j
PRINT
NEXT i
END</syntaxhighlight>
 
==={{header|XBasic}}===
Line 1,077 ⟶ 1,127:
END PROGRAM</syntaxhighlight>
 
==={{header|BASIC256Yabasic}}===
<syntaxhighlight lang="qbasic">dim day$(12), gift$(12)
<syntaxhighlight lang="basic256">dim dia$ = {"first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth"}
for i = 1 to 12: read day$(i): next i
 
for i = 1 to 12: read gift$(i): next i
dim gift$ = {"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 i = 1 to 12
 
print "On the ", day$(i), " day of Christmas,"
for i = 0 to 11
print "On the "; dia$[i]; " dia of Christmas,"
print "My true love gave to me:"
for j = i to 1 step -1: print gift$(j): next j
print gift$[j]
next j
print
next i</syntaxhighlight>
end
 
data "first","second","third","fourth","fifth","sixth"
data "seventh","eighth","ninth","tenth","eleventh","twelfth"
data "A partridge in a pear tree."
data "Two turtle doves and"
data "Three french hens"
data "Four calling birds"
data "Five golden rings"
data "Six geese a-laying"
data "Seven swans a-swimming"
data "Eight maids a-milking"
data "Nine ladies dancing"
data "Ten lords a-leaping"
data "Eleven pipers piping"
data "Twelve drummers drumming"</syntaxhighlight>
 
 
=={{header|BCPL}}==
Line 6,501 ⟶ 6,565:
A partridge in a pear tree.
</pre>
 
 
=={{header|True BASIC}}==
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
<syntaxhighlight lang="qbasic">DATA "first","second","third","fourth","fifth","sixth"
DATA "seventh","eighth","ninth","tenth","eleventh","twelfth"
DATA "A partridge in a pear tree."
DATA "Two turtle doves and"
DATA "Three french hens"
DATA "Four calling birds"
DATA "Five golden rings"
DATA "Six geese a-laying"
DATA "Seven swans a-swimming"
DATA "Eight maids a-milking"
DATA "Nine ladies dancing"
DATA "Ten lords a-leaping"
DATA "Eleven pipers piping"
DATA "Twelve drummers drumming"
 
DIM day$(12), gift$(12)
FOR i = 1 TO 12
READ day$(i)
NEXT i
FOR i = 1 TO 12
READ gift$(i)
NEXT i
 
FOR i = 1 TO 12
PRINT "On the "; day$(i); " day of Christmas,"
PRINT "My true love gave TO me:"
FOR j = i TO 1 STEP -1
PRINT gift$(j)
NEXT j
PRINT
NEXT i
END</syntaxhighlight>
 
=={{header|uBasic/4tH}}==
Line 6,969 ⟶ 6,996:
A partridge in a pear tree.
</pre>
 
 
=={{header|Yabasic}}==
<syntaxhighlight lang="yabasic">dim day$(12), gift$(12)
for i = 1 to 12: read day$(i): next i
for i = 1 to 12: read gift$(i): next i
for i = 1 to 12
print "On the ", day$(i), " day of Christmas,"
print "My true love gave to me:"
for j = i to 1 step -1: print gift$(j): next j
print
next i
end
 
data "first","second","third","fourth","fifth","sixth"
data "seventh","eighth","ninth","tenth","eleventh","twelfth"
data "A partridge in a pear tree."
data "Two turtle doves and"
data "Three french hens"
data "Four calling birds"
data "Five golden rings"
data "Six geese a-laying"
data "Seven swans a-swimming"
data "Eight maids a-milking"
data "Nine ladies dancing"
data "Ten lords a-leaping"
data "Eleven pipers piping"
data "Twelve drummers drumming"</syntaxhighlight>
 
 
=={{header|Z80 Assembly}}==
2,130

edits