The Twelve Days of Christmas: Difference between revisions
Content added Content deleted
imported>Thebeez |
|||
Line 1,001: | Line 1,001: | ||
{{works with|Chipmunk Basic|3.6.4}} |
{{works with|Chipmunk Basic|3.6.4}} |
||
The [[#GW-BASIC|GW-BASIC]] solution works without any changes. |
The [[#GW-BASIC|GW-BASIC]] solution works without any changes. |
||
==={{header|Commodore BASIC}}=== |
|||
Similar to other 8-bit BASICs shown here. This adds a delay and grammar adjustments. Color coding specific to Commodore 64/128. |
|||
<syntaxhighlight lang="gwbasic">1 rem rosetta code |
|||
2 rem twelve days of christmas |
|||
5 print chr$(14):poke 53280,13:poke 53281,1 |
|||
10 dim a$(12),ex$(12):a=1 |
|||
15 for i=1 to 12:read a$(i),ex$(i):next i |
|||
20 for c=1 to 12 |
|||
25 print chr$(147):print chr$(30);" The Twelve Days of Christmas":print |
|||
30 print chr$(28);" On the ";a$(c);" day of Christmas":gosub 200 |
|||
35 print " my true love gave to me: ":print:gosub 200 |
|||
40 for bc=c to 1 step -1 |
|||
45 print tab(4); |
|||
50 if c=1 then print "A "; |
|||
55 if c>1 and bc=1 then print "And a "; |
|||
60 print ex$(bc); |
|||
65 if bc=1 or bc=5 then print "!":gosub 200:gosub 200:goto 75 |
|||
70 print "," |
|||
75 gosub 200 |
|||
80 next bc |
|||
85 rem pause for verse change |
|||
90 print:for t=1 to 500:next t |
|||
95 next c |
|||
100 end |
|||
200 for t=1 to 750:next t:return:rem generic delay |
|||
1000 rem lyrics |
|||
1010 data "first","partridge in a pear tree" |
|||
1020 data "second","Two turtle doves" |
|||
1030 data "third","Three french hens" |
|||
1040 data "fourth","Four calling birds" |
|||
1050 data "fifth","Five golden rings" |
|||
1060 data "sixth","Six geese a-laying" |
|||
1070 data "seventh","Seven swans a-swimming" |
|||
1080 data "eighth","Eight maids a-milking" |
|||
1090 data "ninth","Nine ladies dancing" |
|||
1100 data "tenth","Ten lords a-leaping" |
|||
1110 data "eleventh","Eleven pipers piping" |
|||
1120 data "twelfth","Twelve drummers drumming"</syntaxhighlight> |
|||
==={{header|GW-BASIC}}=== |
==={{header|GW-BASIC}}=== |
||
Line 1,153: | Line 1,194: | ||
data "Eleven pipers piping" |
data "Eleven pipers piping" |
||
data "Twelve drummers drumming"</syntaxhighlight> |
data "Twelve drummers drumming"</syntaxhighlight> |
||
=={{header|BCPL}}== |
=={{header|BCPL}}== |