The Twelve Days of Christmas: Difference between revisions

Added various BASIC dialects (Applesoft BASIC, Chipmunk Basic, GW-BASIC, MSX Basic, QuiteBASIC and XBasic)
(Add SETL)
(Added various BASIC dialects (Applesoft BASIC, Chipmunk Basic, GW-BASIC, MSX Basic, QuiteBASIC and XBasic))
Line 956:
 
=={{header|BASIC}}==
 
<syntaxhighlight lang="basic">10 DEFINT I,J: DEFSTR N,V: DIM N(12),V(12)
20 FOR I=1 TO 12: READ N(I): NEXT
Line 981 ⟶ 980:
220 DATA "Eleven pipers piping"
230 DATA "Twelve drummers drumming"</syntaxhighlight>
 
==={{header|Applesoft BASIC}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|Chipmunk Basic}}===
{{works with|Chipmunk Basic|3.6.4}}
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|GW-BASIC}}===
{{works with|PC-BASIC|any}}
{{works with|BASICA}}
{{works with|Applesoft BASIC}}
{{works with|Chipmunk Basic}}
{{works with|QBasic}}
{{works with|MSX BASIC}}
{{works with|Quite BASIC}}
<syntaxhighlight lang="qbasic">100 CLS : REM 100 HOME for Applesoft BASIC
110 DIM D$(12)
120 DIM G$(12)
130 FOR I = 1 TO 12 : READ D$(I) : NEXT I
140 FOR I = 1 TO 12 : READ G$(I) : NEXT I
150 FOR I = 1 TO 12
160 PRINT "On the ";D$(I);" day of Christmas,"
170 PRINT "My true love gave to me:"
180 FOR J = I TO 1 STEP -1 : PRINT G$(J) : NEXT J
190 PRINT
200 NEXT I
210 END
220 DATA "first","second","third","fourth","fifth","sixth"
230 DATA "seventh","eighth","ninth","tenth","eleventh","twelfth"
240 DATA "A partridge in a pear tree."
250 DATA "Two turtle doves and"
260 DATA "Three french hens"
270 DATA "Four calling birds"
280 DATA "Five golden rings"
290 DATA "Six geese a-laying"
300 DATA "Seven swans a-swimming"
310 DATA "Eight maids a-milking"
320 DATA "Nine ladies dancing"
330 DATA "Ten lords a-leaping"
340 DATA "Eleven pipers piping"
350 DATA "Twelve drummers drumming"</syntaxhighlight>
 
==={{header|MSX Basic}}===
{{works with|MSX BASIC|any}}
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|Quite BASIC}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|XBasic}}===
{{works with|Windows XBasic}}
<syntaxhighlight lang="qbasic">PROGRAM "The Twelve Days of Christmas"
VERSION "0.0000"
 
DECLARE FUNCTION Entry ()
 
FUNCTION Entry ()
DIM day$[11]
day$[0] = "first"
day$[1] = "second"
day$[2] = "third"
day$[3] = "fourth"
day$[4] = "fifth"
day$[5] = "sixth"
day$[6] = "seventh"
day$[7] = "eighth"
day$[8] = "ninth"
day$[9] = "tenth"
day$[10] = "eleventh"
day$[11] = "twelfth"
 
DIM gift$[11]
gift$[0] = "A partridge in a pear tree."
gift$[1] = "Two turtle doves and"
gift$[2] = "Three french hens"
gift$[3] = "Four calling birds"
gift$[4] = "Five golden rings"
gift$[5] = "Six geese a-laying"
gift$[6] = "Seven swans a-swimming"
gift$[7] = "Eight maids a-milking"
gift$[8] = "Nine ladies dancing"
gift$[9] = "Ten lords a-leaping"
gift$[10] = "Eleven pipers piping"
gift$[11] = "Twelve drummers drumming"
 
FOR i = 0 TO 11
PRINT "On the "; day$[i]; " day of Christmas,"
PRINT "My true love gave to me:"
FOR J = i TO 0 STEP -1
PRINT gift$[J]
NEXT J
PRINT
NEXT i
END FUNCTION
END PROGRAM</syntaxhighlight>
 
=={{header|BASIC256}}==
2,130

edits