8-Bit Software Online Conversion
12 Days of Xmas - Listing
1 REM TWELVE DAYS OF CHRISTMAS
10MODE7
20PROCSTART
30PROCMUSIC
40VDU28,0,24,39,0,23;11,255,0;0;0;
50END
60DEFPROCSTART
70PROCINIT
80PROCDATA
90PROCFRONTPAGE
100VDU23;11,0,0;0;0;
110ENDPROC
120DEFPROCINIT
130DIM A$(10),S$(2),P$(11)
140Z%=4:WIDTH0
150FORE%=6TO8:REPEATUNTILADVAL(-E%)=15
:NEXT
160ENDPROC
170DEFPROCDATA
180FORE%=0TO10:READS$:A$(E%)=S$+","+CH
R$10+CHR$13:NEXT
190A$(3)="Five"+CHR$131+"good beer"+CH
R$135+"guides,"+CHR$10+CHR$13
200FORE%=0TO11:READP$(E%):NEXT
210T%=139
220ENDPROC
230DEFPROCFRONTPAGE
240 FORI%=0TO1:PRINTTAB(0,I%);:VDU129,
157,131,141:PRINTTAB(8,I%);"Twelve Days
of Christmas";:NEXT:VDU28,2,24,39,2
250REPEAT:CLS:INPUT'"Enter volume (1=s
oft, 15=loud)"V%:UNTILV%<16 AND V%>0:CLS
260ENDPROC
270DEFPROCMUSIC
280FORD%=1TO12
290IF D%=12 PROCTWELVE:GOTO330
300PROCFIRST:IF D%=1 THEN GOTO350
310IF D%<5 PROCPLAY("@-","7-","$-"):FO
RE%=D%TO2STEP-1:PROCUNDER5:PRINTA$(E%-2)
;:NEXT:PROCPLAY("@-",";-","7-"):GOTO350
320PROCPLAY("@-","7-","$-")
330IF D%>5 THEN FORE%=D%TO6STEP-1:PROC
OVER5:NEXT
340PROCFIVE
350IF D%=12 PROCPLAY("@-C-H-H-H!","4-<
-@-@-@!","+-(-$-$-$!"):PRINT'TAB(8)"< ME
RRY CHRISTMAS !>"'ELSE PROCLAST:IF (D%+1
)MOD3=0 PROCPLAY("<-<-","6-6-",",-,-"):T
%=T%-4 ELSE PROCPLAY("<-<-","4-4-","$-$-
")
360NEXT
370ENDPROC
380DEFPROCTWELVE
390Z%=8:PROCPLAY(" -7!7!7-7-<!<!","-7!
5!4-5-4-7-"," - - - -2-0-/-"):PRINT''"On
the"CHR$129P$(D%-1)CHR$135"day of Chris
tmas"'" my true love gave to me,"
400PROCPLAY("<-<!<-||<!","<-;-9-||7-",
"--+-)-||(-")
410 Z%=Z%/2:PROCPLAY(">->-@-@-A-A->->-
","9-;-9-7-8-:-8-6-",")-+-)-(-)-+-,-.-")
:Z%=Z%*3:PROCPLAY("@-@-@-@-@-@-@-@-","7-
;-9-<-6-6-6-6-","0!0-0---&-&-&-&-")
420PROCPLAY(" -"," -"," -"):Z%=2
430ENDPROC
440DEFPROCFIRST
450PROCPLAY("7!7!7-7-"," - -4-4-"," -
-$-$-")
460PRINT''"On the"CHR$(129+D%MOD6)P$(D
%-1)CHR$135"day of Christmas"'" my true
love gave to me,"
470PROCPLAY("<!<!<-<!<!<!>-@-A->-@-@-@
-"," - -4-4- -;-9-9- -5-7-7-7-"," - -$-$
- - -$-$- -+-$-$-$-")
480ENDPROC
490DEFPROCLAST
500PROCPLAY("A-C-C-E-",";-<-;-9-","&-(
-(-)-")
510IF D%-1 PRINT"and ";
520PRINT"a half pint of lemon shandy."
530 PROCPLAY("A-@-<->->-<-<-<-<-",">-<
-7-7-5-4-4-4-4-",")-+-+-+-+-$-$-$-$-")
540 ENDPROC
550 DEFPROCUNDER5
560PROCPLAY("C-C->-@-A-A-","<-<->-<-;-
;-","(-(-)-)-+-+-")
570ENDPROC
580DEFPROCFIVE
590IF D%=12 THEN Z%=4
600PROCPLAY("C-C-C-C-E-",";-;-;-;-9-",
"(-(-(-(-&-)"):PRINTA$(3);:PROCPLAY("B-B
-B-C-C-C-C-C-C-C-C","6->-<-;-9-;-<->-<-;
-9-","&-&-&-+-&-+---/---+-)-")
610IF D%=12 THEN Z%=6
620PROCPLAY("C-A-@->-<-<-",";-;-7-;-9-
9-","(-(-(-(-----"):PRINTA$(2);:PROCPLAY
("A-A-9-9-<-<-"," - -5-7-7-"," - -&-&-(-
(-"):PRINTA$(1);:IF D%=12 GOTO640 ELSE P
ROCPLAY(">-<;-9-7-","6-4-2-0-/-","*-*-&-
&-+!"):PRINTA$(0);:PROCPLAY("7-@-","2-7-
","+-+-")
630ENDPROC
640PROCPLAY(">-<-;-9-7-","2-7-7-0-/-",
"&-'-(-*-+!"):PRINTA$(0);:PROCPLAY("-@-A
-C-C-E-A-"," -7-9-:!:-9-<-","+-+-)-(-(-)
-&-")
650PRINT"and a half pint of lemon shan
dy."
660PROCPLAY("@-<->->-<-<-<-<-<!","7-9-
;-5-4-4-4-4-4-4!","+-+!+-+-$-$-$-$-$!")
670ENDPROC
680DEFPROCOVER5
690PROCPLAY("C-C->-@-A-","<-9-9-:-;-",
"(-)-)-*-+-"):PRINTA$(E%-2);:PROCPLAY(">
-",";!","+-")
700ENDPROC
710DEFPROCPLAY(S$(0),S$(1),S$(2))
720LOCALE%,F%,N%,P%,Q%,N%,V
730FORE%=1TOLENS$(0)STEP2
740FORF%=0TO2
750P%=ASC(MID$(S$(F%),E%)):Q%=ASC(MID$
(S$(F%),E%+1))
760N%=4*P%-T%:V=V%*(P%<>32)
770IF Q%=ASC"|" SOUND1+F%,0,0,1:GOTO79
0
780IF Q%=ASC"-" SOUND1+F%,V,N%,Z% ELSE
SOUND1+F%,V,N%,Z%-1:SOUND1+F%,0,0,1
790NEXT,
800ENDPROC
810DATATwo pints of stout,Three rum an
d blacks,Four gin and tonics,!,Six pints
of cider,Seven port and lemons
820DATAEight double scotches,Nine swig
s of brandy,Ten pints of lager,Eleven tr
ays of vodka,Twelve crates of Guinness
830DATAfirst,second,third,fourth,fifth
,sixth,seventh,eighth,ninth,tenth,eleven
th,twelfth