-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBBC BASIC Translation.txt
167 lines (166 loc) · 18.1 KB
/
BBC BASIC Translation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
THIS IS THE LIKEL Y CODE FOR THE BBC B THIS IS WHAT WAS PULLED FROM THE BBC B TAPE
10 REM HORSE-RACE ô HORSE-RACE
20 MODE 2 ë2
30 PROCInitialize_characters_variables (òInitialize_characters_variables
40 PROCPunters (òPunters
50 PROCDisplaycash 2òDisplaycash
60 IF Broke=Numberofpunters THEN PROCBroke:QUIT <' ç Broke=Numberofpunters òBroke:à
70 PROCStartingprices FòStartingprices
80 PROCRace P òRace
90 PROCResults ZòResults
100 GOTO 50 d åTr@
110 REM *********************************** n'*******®***************************
120 DEF PROCPunters xÝòPunters
130 VDU 19,0,1,0,0,0,19,1,0,0,0,0 ?ï19,0,1,0,0,0,19,1,0,0,0,0
140 INPUT TAB(0,0)"How many PUNTERS",Numberofpunters ?.è?0,0)"How many PUNTERS",Numberofpunters
150 IF Numberofpunters>10 THEN Numberofpunters<1 ? PRINT TAB(0,0);STRING$(25," "):GOTO 140 ?Gç Numberofpunters>10 ? Numberofpunters<1 ? ñ?0,0);Ä25," "):åtL@
160 DIM Punter$(Numberofpunters) ÞPunter$(Numberofpunters)-
170 DIM Punterstotal(Numberofpunters) ª"ÞPunterstotal(Numberofpunters)
180 DIM Puntersstake(Numberofpunters) ´#ÞPuntersstake(Numberofpunters)
190 DIM Punterspick(Numberofpunters) ¾#ÞPunterspick(Numberofpunters)
210 FOR X= 1 TO Numberofpunters ÈãX= 1 ¸ Numberofpunters
220 IF X>7 THEN COLOUR RND(7) ELSE COLOUR X:INPUT TAB(0,X*2)"Enter NAME",Punter$(X) ç X>7 û³(7) ? ûX Ü#è?0,X*2)"Enter NAME",Punter$(X)
230 IF LEN(Punter$(X))>5 OR LEN(Punter$(X))<1 PRINT TAB(0,X*2);STRING$(25," "):GOTO 220 æCç ©(Punter$(X()>5!? ©(Punter$(X))<1 ? ñ?0,X*2);Ä25," "):åd\@
240 NEXT X ðíX
250 COLOUR 4:PRINT ''"ALL PUNTERS START WITH £100" ú0û4:ñ''"ALL PUNTERS START WITH `100"
260 FOR X=1 TO Numberofpunters:Punterstotal(X)=100:NEXT X 3ãX=1¸ Numberofpunters:Punterstotal(X)=100:í
270 PRINT ''';TAB(4);"Press SPACE":REPEAT:A$=GET:UNTIL A$=" " 2û14:ñ''';?(4);"Press SPACE":õ:A$=¾:ý A$=" "
280 VDU 19,0,0,0,0,0,19,1,1,0,0,0 "ï19,0,0,0,0,0,19,1,1,0,0,0
290 ENDPROC " á
300 REM ********************************** ,&**********************************
310 DEF PROCDisplaycash 6ÝòDisplaycash
320 CLS @Û
330 Broke=0 JBroke=0
340 VDU 19,0,5,0,0,0,19,5,0,0,0,0 Tï19,0,5,0,0,0,19,5,0,0,0,0
350 IF Numberofpunters>1 PROCSORT ^ç Numberofpunters>1 òSORT
360 Y=0:REPEAT:Y=Y+1 hY=0:õ:Y=Y+1
370 IF Punterstotal(Y)=0 THEN Broke=Broke+1 r( ç Punterstotal(Y)=0 ? Broke=Broke+1
380 COLOUR Y:IF Y>7 COLOUR RND(7) |ûY:ç Y>7 û³(7)
390 PRINT TAB(0,Y*3);Y;") ";Punter$(Y);" has £";Punterstotal(Y)?8ñ?0,Y*3);Y;") ";Punter$(Y);" has `";Punterstotal(Y)
400 UNTIL Y = Numberofpunters ý Y = Numberofpunters
410 COLOUR 14:PRINT "Press SPACE":REPEAT:A$=GET:UNTIL A$=" " ?.û14:ñ'" Press SPACE":õ:A$=¾:ý A$=" "
420 VDU 19,0,0,0,0,0,19,5,5,0,0,0 ¤#ï19,0,0,0,0,0,19,5,5,0,0,0
430 ENDPROC ®á
440 REM *********************************** ¸'***********************************
450 DEF PROCStartingprice ÂÝòStartingprice
460 CLS ³?æ?
470 VDU 19,0,2,0,0,0,19,2,0,0,0,0 »(Èçô19,0,2,0,0,0,19,2,0,0,0,0
480 COLOUR 13:PRINT TAB(0,0)STRING$(20,"-") àû13:ñ?0,0)Ä20,"-")
490 COLOUR 9:PRINT TAB(0,1)"* STARTING PRICES *" ê"û9:ñ?0,1)"* STARTING PRICES *"
500 COLOUR 13:PRINT TAB(0,2)STRING$(20,"-") ôû13:ñ?0,2)Ä20,"-")
510 X=0:REPEAT:X=X+1:PRICE(X)=RND(5)*5 þ X=0:õ:X=X+1:PRICE(X)=³(5)*5
520 COLOUR X ûX
530 PRINT TAB(0,X*2+2);X;" ";Horse$(X);" ";PRICE(X);"~1" 2ñ?0,X*2+2);X;" ";Horse$(X);" ";PRICE(X);"~1"
540 UNTIL X=7 ý X=7
550 COLOUR 1:PRINT TAB(0,21)STRING$(20,"=") &û1:ñ?0,21)Ä20,"R=")
560 COLOUR 10:PRINT TAB(3,22)"PLACE YOUR BETS" 0$û10:ñ?3,22)"PLACE YOUR BETS"
570 COLOUR 1:PRINT TAB(0,23)STRING$(20,"=") :û1:ñ?0,23)Ä20,"=")
580 X=0:REPEAT:X=X+1 DX=0:õ:X=X+1
590 IF Punterstotal(X)=0 THEN COLOUR 12:PRINT TAB(0,24);Punter$(X);" You are BROKE":COLOUR 5:PRINT TAB(0,26);" NO BETS!!!!":PROCtune(5,2):T=???(200):Puntersstake(X)=0:Punterspick(X)=8:GOTO 660 N?çPunterstotal(X)=0 û12:ñ?0,24);Punter$(X);" You are BROKE":û5:ñ?0,26);" NO BETS!!!!":òtune(5,2):T=¦(200):Puntersstake(X)=0:Punterspick(X)=8:åt^B
600 COLOUR 5:PRINT TAB(0,24);Punter$(X);" You have £";Punterstotal(X):INPUT TAB(0,26)" Pick a Horse 1-7",Punterspick(X) Xcû5:ñ?0,24);Punter$(X);"You have `";Punterstotal(X):è?0,26)" Pick a Horse 1-7",Punterspick(X)
610 IF Punterspick(X)>7 OR Punterspick(X)<1 THEN PRINT TAB(0,26);STRING$(20," "):PRINT TAB(0,27);STRING$(20," "):GOTO 600 bUçPunterspick(X)>7 ? Punterspick(X)<1 ? ñ?0,26);Ä20," "):ñ?0,27);Ä20," "):åDXB
620 COLOUR 6:INPUT TAB(2,28)"How much",Puntersstake(X) l,û6:è?3,28)"How much",Puntersstake(X)
630 IF INT(Puntersstake(X))<>Puntersstake(X) OR Puntersstake(X)<1 THEN PRINT TAB(0,28);STRING$(20," "):PRINT TAB(0,29);STRING$(20," "):GOTO 600 vhç ¨(Puntersstake(X))<>Puntersstake(X) ? Puntersstake~?N?(X)<1:ñ?0,28);Ä20," "):ñ?0,29);Ä20," "):åDlB
640 IF Puntersstake(X)>Puntertotal(X):COLOUR 8:PRINT TAB(2,29)"SORRY NO CREDIT!":SOUND 1,-15,100,10:FOR T=1 TO 4000:NEXT T:PRINT TAB (0,28);STRING$(20," "):PRINT TAB (0,29);STRING$(20," "):GOTO 600 ?? ç Puntersstake(X)>Punterstotal(X):û8:ñ?2,29)"SORRY NO CREDIT!":Ô1,-15,100,10:ãT=1¸4000:í:ñ?0,28);Ä20," "):ñ?0,29);Ä20," "):åDlB
650 Punterstotal(X)=Punterstotal(X)-Puntersstake(X) ?3Punterstotal(X)=Punterstotal(X)-Puntersstake(X)
660 C=24 ?C=24
670 PRINT TAB(0,C) STRING$(20," "):C=C+1:IF C>29 THEN GOTO ??? ELSE GOTO 660 ?/ñ?0,C)Ä20,Dïïï" "):C=C+1:ç C>29 ? åthB ? åt^B
680 UNTIL X=Numberofpunters ¨ý X=Numberofpunters
690 VDU 19,0,0,0,0,0,19,2,2,0,0,0 ²!ï19,0,0,0,0,0,19,2,2,0,0,0
700 ENDPROC ¼á
710 REM *********************************** Æ'***********************************
720 DEF PROCRace ÐÝòRace
730 CLS ÚÛ
740 VDU 19,0,2,0,0,0,19,2,0,0,0,0 äï19,0,2,0,0,0,19,2,0,0,0,0
750 COLOUR 133:FOR X=20 TO 30:PRINT TAB(0,X);STRING$(20," "):NEXT X î&û133:ãX=20 ¸ 30:ñ?0,X);Ä20," "):í
760 COLOUR 7:PRINT TAB(0,1);STRING$(28,"-") øû7:ñ?0,1();Ä28,"-")
770 COLOUR 4 û4
779 REM ñ?0,1?)ÿïÿoä9)"Punter Horse odds~1"
780 PRINT TAB(0,1)"Punter Horse odds~1" #ñ?0,1?)ÿïÿoä9)"Punter Horse odds~1"
790 COLOUR 7 û7
800 PRINT TAB(0,20);STRING$(20,"-") ñ?0,20);Ä20,"-")
810 X=0:REPEAT:X=X+1 *X=0:õ:X=X+1
820 COLOUR 3 4û3
830 IF Punterspick(X)=8 THEN PRICE(Punterspick(X))=0 >-çPunterspick(X)=8 PRICE(Punterspick(X))=0
840 PRINT TAB(0,20+X);Punter$(X):COLOUR 4:PRINT TAB(6,20+X);Punterpick(X):COLOUR 1:PRINT TAB(7,20+X);Horse$(Punterspick(X)):COLOUR 3:PRINT TAB(18,20+X);PRICE(Punterpick(X)) H?ñ?0,20+X);Punter$(X):û4:ñ?6,20+X);Punterspick(X):û1:ñ?7,20+X);Horse$(Punterspick(X)):û3:ñ?18,20+X);PRICE(Punterspick(X))
850 UNTIL X=Numberofpunters Rý i?ÿïïX=Numberofpunters
860 COLOUR 128 \û128
870 FOR X=1 TO 7:startpos(X)=11+(PRICE(X)/5):NEXT X f*ãX=1¸7:startpos(X)=11+(PRICE(X)/5):í
880 FOR X=2 TO 14 STEP 2:COLOUR X/2:PRINT TAB(0,X+1);CHR$230;startpos(X/2));LEGSOUT$;X/2:NEXT X pDã X=2¸14 ? 2:ûX/2:ñ?0,X+1);½230;?startpos(X/2));LEGSOUT$;X/2:í
890 PRINT TAB(0,1);CHR$229;STRING$(19,"_");PRINT TAB(0,16);CHR$229;STRING$(19,"_") z1ñ?0,1);½229;Ä19,"_"):ñ?0,16);½229;Ä19,"_")
900 SOUND 0,1,4,2:T=???(50) ?Ô0,1,4,2:T=¦(50)
910 REPEAT:HORSE=RND(7) ?õ:HORSE=³(7)
920 COLOUR HORSE ?ûHORSE
930 PRINT TAB(startpos(HORSE),HORSE*2+1);LEGSIN$ ¢+ñ?startpos(HORSE),HORSE*2+1);LEGSIN$
940 FOR T=1 to 500:NEXT T ¬ãT=1¸500:í
950 SOUND 1,-15,4,RND(1.5):SOUND 0,1,4,.5:SOUND 0,0,0,2:SOUND 2,1,3,.5 ¶4Ô1,-15,4,³(1.5):Ô0,1,4,.5:Ô0,0,0,2:Ô2,1,3,.5
960 SOUND 1,-15,1,RND(1.5):SOUND 0,2,4,1:SOUND 0,0,0,2:SOUND 0,2,3,1 À.Ô1,-15,1,³(1.5):Ô0,2,4,1:Ô0,0,0,2:Ô0,2,3,1
970 PRINT TAB(startpos(HORSE),HORSE*2+1);LEGSOUT$ Ê-ñ?startpos(HORSE),HORSE*2+1);LEGSOUT$
980 startpos(HORSE)=startpos(HORSE)-1 Ô%startpos(HORSE)=startpos(HORSE)-1
990 UNTIL startpos(HORSE)<0 Þýstartpos(HORSE)<0
1000 ENDPROC èá
1010 REM *********************************** ò'***********************************
1020 DEF PROCResults üÝòResults
1030 FOR X=18 TO 29:PRINT TAB(0,X);STRING$(20," "):NEXT X ãX=18¸29:ñ?0,X);Ä20," "):í
1040 COLOUR 12:PRINT TAB(0,18)"WINNER IS NUMBER ";HORSE;'';Horse$(HORSE);" at "PRICE(HORSE);"~1" Rû12:ñ?0,18)"WINNER IS NUMBER ";HORSE;'';Horse$(HORSE);" at "PRICE(HORSE);"~1"
1050 X=0:REPEAT:X=X+1 X=0:õ:X=X+1
1060 IF Punterspick(X)=HORSE PRINT '';Punter$(X);" wins £";Puntersstake(X)*PRICE(HORSE)+Puntersstake(X):Punterstotal(X)=Punterstotal(X)+Puntersstake(X)*PRICE(HORSE)+Puntersstake(X) $¯çPunterspick(X)=HORSE ñ'';Punter$(X);" wins `";Puntersstake(X)*PRICE(HORSE)+Puntersstake(X):Punterstotal(X)=Punterstotal(X)+Puntersstake(X)*PRICE(HORSE)+Puntersstake(X)
1070 UNTIL X=Numberofpunters .ý X=Numberofpunters
1080 PROCtune(33,1) 8òtune(33,1)
1090 COLOUR 2:PRINT "Press SPACE":REPEAT:A$=GET:UNTIL A$=" " B0û2:ñ''" Press SPACE":õ:A$=¾:ý A$=" "
1100 VDU 19,0,0,0,0,0,19,2,2,0,0,0 L!ï19,0,0,0,0,0,19,2,2,0,0,0
1110 ENDPROC Vá
1120 REM ********************************** `&**********************************
1130 DEF PROCSORT j?6(ÝòSORT
1140 FOR S=1 TO Numberofpunters tãS=1 ¸ Numberofpunters
1150 M=0 ~M=0
1160 I=0:REPEAT:I=I+1 ?I=0:õ:I=I+1
1170 IF Punterstotal(I)>=Punterstotal(I+1) THEN GOTO 1220 ?/ çPunterstotal(I)>=Punterstotal(I+1) ? dDD
1180 X=Punterstotal(I):Y$=Punter$(I) ?#X=Punterstotal(I):Y$=Punter$(I)
1190 Punterstotal(I)=Punterstotal(I+1):Punter$(I)=Punter$(I+1) ¦=Punterstotal(I)=Punterstotal(I+1):Punter$(I)=Punter$(I+1)
1200 Punterstotal(I+1)=X:Punter$(I+1)=Y$ °'Punterstotal(I+1)=X:Punter$(I+1)=Y$
1210 M=1 º M=1
1220 UNTIL I=Numberofpunters-1 Äý I=Num?berofpqnters-1
1230 IF M=0 THEN ENDPROC Î çM=0 ? á
1240 NEXT S:ENDPROC Ø íS:á
1250 REM *********************************** â'***********************************
1260 DEF PROCInitialize_characters_variables ì&Ý òInitialize_characters_variables
1270 *FX11,0 ö*FX11,0
1280 VDU 23;8202;0;0;0; ï23;8202;0;0;0;
1290 DIM startpos(7):DIM Horse$(8):DIM PRICE(8) %Þstartpos(7):ÞHorse$(8):ÞPRICE(8)
1300 VDU 23,225,16,56,48,79,31,40,80,32 $ï23,225,16,56,48,79,31,40,80,32
1310 VDU 23,226,0,0,64,128,192,160,80,32 $ï23,226,0,0,64,128,192,160,80,32
1320 VDU 23,227,16,56,48,79,31,25,20,13 (#ï23,227,16,56,48,79,31,25,20,13
1330 VDU 23,228,0,0,64,128,192,64,128,0 2#ï23,228,0,0,64,128,192,64,128,0
1340 VDU 23,229,56,68,68,68,56,16,16,16 <#ï23,229,56,68,68,68,56,16,16,16
1350 VDU 23,230,16,16,16,16,16,16,16,16 F#ï23,230,16,16,16,16,16,16,16,16
1360 VDU 23,255,0,0,0,0,0,0,0,0 Pï23,255,0,0,0,0,0,0,0,0
1370 LEGSOUT$=CHR$225+CHR$226+CHR$255 ZLEGSOUT$=½225+½226+½255
1380 LEGSIN$=CHR$227+CHR$228+CHR$255 dLEGSIN$=½227+½228+½255
1390 Horse$(1)="Redwold":Horse$(2)="Black Jet":Horse$(3)="Yellow Dog":Horse$(4)="Super Blue":Horse$(5)="Hot Magenta":Horse$(6)="Cyan Runner":Horse$(7)="White Flash":Horse$(8)=CHR$8+CHR$8+" NO BET" nÀHorse$(1)="Redwold":Horse$(2)="Black Jet":Horse$(3)="Yellow Dog":Horse$(4)="Super Blue":Horse$(5)="Hot Magenta":Horse$(6)="Cyan Runner":Horse$(7)="White Flash":Horse$(8)=½8+½8+" NO BET"
1400 ENDPROC xá
1410 REM ********************************** ?&**********************************
1420 DEF PROCtune(len,dur) ?Ýòtune(len,dur)
1430 LOCAL X% ?êX%
1440 ENVELOPE 1,1,0,0,0,0,0,0,126,-4,0,-63,126,100 .â1,1,0,0,0,0,0,0,126,-4,0,-63,126,100
1450 ENVELOPE 2,1,0,0,0,0,0,0,63,10,0,-63,63,110 ª'â2,1,0,0,0,0,0,0,63,10,0,-63,63,110
1460 FOR X%=1 TO len ´ã X%=1¸len
1470 READ note,duration ¾ó note,duration
1480 duration=duration*dur Èduration=duration*dur
1490 IF note=0 THEN vol=0 ELSE vol=2 Òç note=0 vol=0 ? vol=2
1500 SOUND &0201,vol,note,duration:SOUND &0202,vol,note,duration:SOUND &0203,vol,note,duration ÜPÔ&0201,vol,note,duration:Ô&0202,vol,note,duration:Ô&0203,vol,note,duration
1510 NEXT X% æíX%
1520 RESTORE ð÷
1530 ENDPROC úá
1540 DATA 149,5,149,5,149,5,137,2.5,137,2.5,149,2.5,149,2.5,157,5,149,5,137,5,0,5,137,5,129,15,137,5,129,10 iÜ 149,5,149,5,149,5,137,2.5,137,2.5,149,2.5,149,2.5,157,5,149,5,137,5,0,5,137,5,129,15,137,5,129,10
1550 DATA 149,5,149,5,149,5,137,5,149,2.5,149,2.5,157,5,149,2.5,149,2.5,137,5,0,5,137,2.5,129,2.5,121,2.5,129,2.5,137,5,129,5,121,10 ?Ü 149,5,149,5,149,5,137,5,149,2.5,149,2.5,157,5,149,2.5,149,2.5,137,5,0,5,137,2.5,129,2.5,121,2.5,129,2.5,137,5,129,5,121,10
1560 DEF PROCBroke Ý òBroke
1570 CLS "Û
1580 PRINT TAB(0,6)"All punters are" ,ñ?0,6)"All punters are"
1590 PRINT TAB(0,8)" BROKE!!!" 6ñ?0,8)" BROKE!!!"
1600 PRINT TAB(0,12)"The meeting ends" @ ñ?0,12)"The meeting ends"
1610 PROCtune(33,2) Jòtune(33,2)
1620 PRINT ''''"Another race y/n?":A$=GET:IF A$="Y" OR A$="y" THEN RUN T9ñ''''"Another race y/n?":A$=¾:ç A$="Y" ? A$="y" ù
1630 *FX11,15 ^*FX11,15
1640 ENDPROC há
ÿ±)ÇFHæ:A !þ~Àñï/E}yÿv>|ºø¿è@ã!?qàÃ