8-Bit Software Online Conversion

Horse Race. Game - Listing

10 REM National 20 REM By V.J.Horgan 30 REM Horse-race Game 40 *KEY10 OLD|MGOTO 130|M 50 ON ERROR MODE 6:REPORT:PRINT"AT LI NE ";ERL:IF ERR=17 GOTO 270 60 VDU23,255,255,255,255,255,255,255, 255,255,23,224,0,0,0,3,3,4,8,16,23,226,1 6,55,254,248,248,4,2,1,23,230,8,236,127, 31,31,32,64,128,23,232,0,0,0,192,192,32, 16,8,23,240,240,240,240,240,240,240,240, 240 70 MODE 4 80 CLS:VDU19;3;0;:VDU19,1,1,0,0,0 90 FOR p%=3 TO 12:PRINTTAB(p%,12)CHR$ 224;CHR$226 100 PROCwait(20):NEXT 110 FOR p%=29 TO 20 STEP-1:PRINTTAB(p% ,14)CHR$230;CHR$232 120 PROCwait(20):NEXT 130 VDU19 1,4,0,0,0 140 PRINTTAB(14,12)"NATIONAL";TAB(16,1 4)"RACE";TAB(14,16)"by V.J.H." 150 PROCsound:PROCwait(300) 160 CLS:VDU19,1,0,0,0,0 170 MODE7 180 PRINT:PRINT;CHR$(131);"Six horses are entered for the race." 190 PRINT;CHR$(131);" There are 2 fenc es & 1 water-jump." 200 PRINT;CHR$(131);"Any horse might f all at these-dependent";CHR$(131);"on it s position." 210 PRINT:PRINT;CHR$(131);"A Tote is d isplayed with the runners" 220 PRINT;CHR$(131)"and prices.Names a nd Bets are entered." 230 PRINT:PRINT"After each race the 1s t and 2nd horses are declared and the p ayout for the placings given." 240 PRINT:PRINT"A new Tote is entered by pressing ESCAPE" 250 PRINT"Press T for Tote." 260 REPEAT UNTIL GET=84 270 MODE3 280 CLS:VDU19,0,3,0,0,0:VDU19,1,0,0,0, 0 290 PROCtote:REPEAT UNTIL GET=69 300 MODE2 310 F%=0 320 VDU28,0,8,19,0:COLOUR 135:CLS 330 X=RND(-TIME) 340 Y1%=700:Y2%=625:Y3%=550:Y4%=475:Y5 %=400:Y6%=325 350 PROCfield 360 PROCmovefor 370 DEF PROCfield 380 COLOUR 2:PRINTTAB(0,7)STRING$(40," ÷");TAB(0,1) STRING$(19,"÷") 390 VDU24,0;0;1275;750; 400 GCOL0,130:CLG 410 GCOL0,4:MOVE 150,200:DRAW 150,700 420 VDU5:GCOL0,2:MOVE 0,200:PRINT STRI NG$(19,"^"):PROCbuz(30) 430 PROCedge(750):PROCedge(200) 440 PROCjump(3,950) 450 PROCnum(4,"1","2","3","4","5","6") 460 VDU4:COLOUR 1:PRINTTAB(1,4)"Under Starter's Orders" 470 PROCsound 480 PRINTTAB(3,6)"Press S to Start" 490 ENDPROC 500 DEF PROCfence(w%) 510 VDU 5:GCOL0,0 520 MOVE w%,175+(75*RND(7)):VDU255 530 ENDPROC 540 DEF PROCmovefor 550 VDU5:F%=0:X%=10 560 REPEAT 570 Y1%=Y1%:Y2%=Y2%:Y3%=Y3%:Y4%=Y4%:Y5 %=Y5%:Y6%=Y6% 580 r1%=RND(100):r2%=RND(100):r3%=RND (100):r4%=RND(70):r5%=RND(70):r6%=RND(60 ) 590 a%=X%+r1%:b%=X%+r2%:c%=X%+r3%:d%=X %+r4%:e%=X%+r5%:f%=X%+r6% 600 MOVE a%,Y1%:GCOL0,1:VDU224;226 610 MOVE b%,Y2%:GCOL0,3:VDU224;226 620 MOVE c%,Y3%:GCOL0,4:VDU224;226 630 MOVE d%,Y4%:GCOL0,5:VDU224;226 640 MOVE e%,Y5%:GCOL0,7:VDU224;226 650 MOVE f%,Y6%:GCOL0,6:VDU224;226 660 IF X%=10 P=GET:IF P=83 GOTO 670 670 IF X%=40 VDU4:CLS:PRINTTAB(5,4)"TH EY'RE OFF !" 680 IF X%=850 PROCfence(950) 690 PROCpointfall 700 IF X%=350 VDU4:CLS 710 PROCbuz(2):PROCrub1:PROCbuz(1):PRO Cwait(15):X%=X%+20 720 UNTIL X%=1270:PROCfield2:PROCmovef or2 730 ENDPROC 740 DEF PROCrub1 750 VDU5 760 MOVE a%,Y1%:GCOL0,2:VDU224;226 770 MOVE b%,Y2%:GCOL0,2:VDU224;226 780 MOVE c%,Y3%:GCOL0,2:VDU224;226 790 MOVE d%,Y4%:GCOL0,2:VDU224;226 800 MOVE e%,Y5%:GCOL0,2:VDU224;226 810 MOVE f%,Y6%:GCOL0,2:VDU224;226 820 ENDPROC 830 DEF PROCpointfall 840 IF POINT(a%,Y1%)=0 THEN Y1%=140:y% =1:PROCfall("Ginsling") 850 IF POINT(b%,Y2%)=0 THEN Y2%=120:y% =2:PROCfall("Scotch Mist") 860 IF POINT(c%,Y3%)=0THEN Y3%=100:y%= 3:PROCfall("Threelegs") 870 IF POINT(d%,Y4%)=0 THEN Y4%=80:y%= 4:PROCfall("Irish Stew") 880 IF POINT(e%,Y5%)=0 THEN Y5%=60:y%= 5:PROCfall("O.A.P.") 890 IF POINT(f%,Y6%)=0 THEN Y6%=40:y%= 6:PROCfall("Hangover") 900 ENDPROC 910 DEF PROCwait(t%) 920 TIME=0:REPEAT UNTIL TIME>t% 930 ENDPROC 940 DEF PROCres 950 VDU19,3,0,0,0,0:VDU19,1,0,0,0,0:VD U5 960 GCOL0,2:MOVE 50,400:PRINT"ESCAPE f or Tote" 970 REPEAT UNTIL FALSE 980 ENDPROC 990 DEF PROCfall(h$) 1000 VDU4:PROCtune(2,1) 1010 COLOUR 0 1020 PRINTTAB(2,y%) h$;" Falls" 1030 VDU5 1040 ENDPROC 1050 DEF PROCsound 1060 FOR s= 1 TO 3:SOUND 1,-15,128,3:SO UND 1,0,128,3:NEXT 1070 FOR s= 1 TO 3:SOUND 1,-15,100,3:SO UND 1,0,100,3:NEXT 1080 SOUND 1,-15,80,20 1090 ENDPROC 1100 DEF PROCtune(z,t) 1110 FOR I=1 TO z 1120 SOUND 1,2,100,20 1130 ENVELOPE 2,t,4,-4,20,5,20,10,0,0,0 ,0,0,0 1140 PROCwait(50):NEXT I 1150 ENDPROC 1160 DEF PROCbuz(z) 1170 SOUND 0,2,4,z:ENVELOPE 2,1,1,-1,3, 7,5,5,126,0,0,-126,126,126 1180 ENDPROC 1190 DEF PROCtote 1200 PRINT:PRINT" TOT E" 1210 PRINT:PRINT" Enter the Name and Be t for each horse pressing RETURN after each entry" 1220 PRINT" The bets are entered in Pou nds." 1230 PRINTTAB(2,6)"RUNNERS ODDS NAME BET" 1240 PRINTTAB(2,8)"1 Ginsling";TAB(19,8 )"2-1" 1250 PRINTTAB(2,10)"2 Scotch Mist";TAB( 19,10)"2-1" 1260 PRINTTAB(2,12)"3 Threelegs";TAB(19 ,12)"3-1" 1270 PRINTTAB(2,14)"4 Irish Stew";TAB(1 9,14)"4-1" 1280 PRINTTAB(2,16)"5 O.A.P";TAB(19,16) "4-1" 1290 PRINTTAB(2,18)"6 Hangover";TAB(19, 18)"5-1" 1300 PROCpunt 1310 PRINT"Is Printout of Above Require d ? Y/N" 1320 X=GET:IF X=89 GOTO 1330 ELSE GOTO 1340 1330 VDU2:PROCprint:VDU3 1340 PRINTTAB(3,24)"Press E to enter Ra cecourse" 1350 ENDPROC 1360 DEF PROCwin(T%,place$,horse$) 1370 VDU4:COLOUR 0:PRINTTAB(1,T%)place$ ;"--";horse$ 1380 ENDPROC 1390 DEF PROCpay(No%,place%,line%) 1400 IF place%=2 Bet=Bet/2 ELSE Bet=Bet 1410 IF No%=1 Bet=bet1:Od%=2:Name$=name 1$ 1420 IF No%=2 Bet=bet2:Od%=2:Name$=name 2$ 1430 IF No%=3 Bet=bet3:Od%=3:Name$=name 3$ 1440 IF No%=4 Bet=bet4:Od%=4:Name$=name 4$ 1450 IF No%=5 Bet=bet5:Od%=4:Name$=name 5$ 1460 IF No%=6 Bet=bet6:Od%=5:Name$=name 6$ 1470 PRINTTAB(1,line%)"To ";Name$;" pay £";(Od%*Bet) 1480 GCOL0,1:VDU5:MOVE 10,400:PRINT"Pre ss ESCAPE for new Tote." 1490 MOVE 10,300:PRINT"Press BREAK to s tart again." 1500 ENDPROC 1510 DEF PROCnum(c%,a$,b$,c$,d$,e$,f$) 1520 GCOL0,c%:VDU5 1530 MOVE 5,700:PRINTa$ 1540 MOVE 5,625:PRINTb$ 1550 MOVE 5,550:PRINTc$ 1560 MOVE 5,475:PRINTd$ 1570 MOVE 5,400:PRINTe$ 1580 MOVE 5,325:PRINTf$ 1590 ENDPROC 1600 DEFPROCfield2 1610 COLOUR 2:PRINTTAB(0,7)STRING$(40," ÷");TAB(0,1) STRING$(19,"÷") 1620 VDU24,0;0;1275;750;:GCOL0,130:CLG 1630 PROCedge(750):PROCedge(200) 1640 PROCjump(3,500) 1650 ENDPROC 1660 DEFPROCmovefor2 1670 VDU5:X%=10 1680 REPEAT 1690 Y1%=Y1%:Y2%=Y2%:Y3%=Y3%:Y4%=Y4%:Y5 %=Y5%:Y6%=Y6% 1700 r1%=RND(150):r2%=RND(120):r3%=RND (100):r4%=RND(70):r5%=RND(50):r6%=RND(50 ) 1710 a%=X%+r1%:b%=X%+r2%:c%=X%+r3%:d%=X %+r4%:e%=X%+r5%:f%=X%+r6% 1720 MOVE a%,Y1%:GCOL0,1:VDU224;226 1730 MOVE b%,Y2%:GCOL0,3:VDU224;226 1740 MOVE c%,Y3%:GCOL0,4:VDU224;226 1750 MOVE d%,Y4%:GCOL0,5:VDU224;226 1760 MOVE e%,Y5%:GCOL0,7:VDU224;226 1770 MOVE f%,Y6%:GCOL0,6:VDU224;226 1780 IF X%=350 PROCfence(500) 1790 PROCpointfall 1800 PROCbuz(2):PROCrub1:PROCbuz(1):PRO Cwait(15):X%=X%+20 1810 UNTIL X%=1270 1820 IF F%=1 PROCfield4:PROCmovefor3:EN D 1830 F%=1:PROCfield2:PROCmovefor2 1840 ENDPROC 1850 DEFPROCfield4 1860 VDU24,0;0;1275;750;:GCOL0,130:CLG 1870 PROCjump(0,1150) 1880 PROCjump(9,1250) 1890 ENDPROC 1900 DEFPROCmovefor3 1910 VDU5:F%=0:X%=10 1920 REPEAT 1930 Y1%=Y1%:Y2%=Y2%:Y3%=Y3%:Y4%=Y4%:Y5 %=Y5%:Y6%=Y6% 1940 r1%=RND(100):r2%=RND(100):r3%=RND (100):r4%=RND(70):r5%=RND(70):r6%=RND(60 ) 1950 a%=X%+r1%:b%=X%+r2%:c%=X%+r3%:d%=X %+r4%:e%=X%+r5%:f%=X%+r6% 1960 MOVE a%,Y1%:GCOL0,1:VDU224;226 1970 MOVE b%,Y2%:GCOL0,3:VDU224;226 1980 MOVE c%,Y3%:GCOL0,4:VDU224;226 1990 MOVE d%,Y4%:GCOL0,5:VDU224;226 2000 MOVE e%,Y5%:GCOL0,7:VDU224;226 2010 MOVE f%,Y6%:GCOL0,6:VDU224;226 2020 IF X%=850 VDU4:CLS 2030 PROCwinner 2040 PROCbuz(2):PROCrub1:PROCbuz(1):PRO Cwait(15):X%=X%+20 2050 UNTIL X%=1270:PROCfin 2060 DEFPROCjump(c%,W%) 2070 GCOL0,c%:MOVE W%,200:MOVE W%,700:P LOT85,W%+70,200:PLOT85,W%+70,700 2080 ENDPROC 2090 DEFPROCwinner 2100 IF POINT(a%,Y1%)=0 PROCjump(2,1150 ):Y1%=50:PROCwin(1,"First","GINSLING"):b et1=bet1:PROCpay(1,1,4) ELSE IF POINT(a% ,Y1%)=9 PROCjump(2,1250):Y1%=50:PROCwin( 2,"Second","GINSLING"):bet1=bet1/2:PROCp ay(1,2,5) 2110 IF POINT(b%,Y2%)=0 PROCjump(2,1150 ):Y2%=50:PROCwin(1,"First","SCOTCH MIST" ):bet2=bet2:PROCpay(2,1,4) ELSE IF POINT (b%,Y2%)=9 PROCjump(2,1250):Y2%=50:PROCw in(2,"Second","SCOTCH MIST"):bet2=bet2/2 :PROCpay(2,2,5) 2120 IF POINT(c%,Y3%)=0 PROCjump(2,1150 ):Y3%=50:PROCwin(1,"First","THREELEGS"): bet3=bet3:PROCpay(3,1,4)ELSE IF POINT(c% ,Y3%)=9 PROCjump(2,1250):Y3%=50:PROCwin( 2,"Second","THREELEGS"):bet3=bet3/2:PROC pay(3,2,5) 2130 IF POINT(d%,Y4%)=0 PROCjump(2,1150 ):Y4%=50:PROCwin(1,"First","IRISH STEW") :bet4=bet4:PROCpay(4,1,4)ELSE IF POINT(d %,Y4%)=9 PROCjump(2,1250):Y4%=50:PROCwin (2,"Second","IRISH STEW"):bet4=bet4/2:PR OCpay(4,2,5) 2140 IF POINT(e%,Y5%)=0 PROCjump(2,1150 ):Y5%=50:PROCwin(1,"First","O.A.P."):bet 5=bet5:PROCpay(5,1,4)ELSE IF POINT(e%,Y5 %)=9 PROCjump(2,1250):Y5%=50:PROCwin(2," Second","O.A.P."):bet5=bet5/2:PROCpay(5, 2,5) 2150 IF POINT(f%,Y6%)=0 PROCjump(2,1150 ):Y6%=50:PROCwin(1,"First","HANGOVER"):b et6=bet6:PROCpay(6,1,4)ELSE IF POINT(f%, Y6%)=9 PROCjump(2,1250):Y6%=50:PROCwin(2 ,"Second","HANGOVER"):bet6=bet6/2:PROCpa y(6,2,5) 2160 ENDPROC 2170 DEFPROCfin 2180 X=GET:IF X=82 GOTO 300 ELSE IF X=8 4 GOTO 270 2190 ENDPROC 2200 DEFPROCline 2210 PROCnum(4,"1","2","3","4","5","6") 2220 ENDPROC 2230 DEFPROCpunt 2240 INPUTTAB(28,8)name1$;TAB(40,8)bet1 2250 INPUTTAB(28,10)name2$;TAB(40,10)be t2 2260 INPUTTAB(28,12)name3$;TAB(40,12)be t3 2270 INPUTTAB(28,14)name4$;TAB(40,14)be t4 2280 INPUTTAB(28,16)name5$;TAB(40,16)be t5 2290 INPUTTAB(28,18)name6$;TAB(40,18)be t6 2300 ENDPROC 2310 DEFPROCedge(ed%) 2320 FOR f%=20 TO 1270 STEP 30 2330 VDU5:GCOL0,0:MOVE f%,ed%:PRINT "I" :NEXT 2340 ENDPROC 2350 DEF PROCprint 2360 PRINT"1 Ginsling 2-1 ";name1$" "; bet1 2370 PRINT"2 Scotch Mist 2-1 ";name2$" ";bet2 2380 PRINT"3 Threelegs 3-1 ";name3$" " ;bet3 2390 PRINT"4 Irish Stew 4-1 "name4$" ";bet4 2400 PRINT"5 O.A.P 4-1 ";name5$" ";bet 5 2410 PRINT"6 Hangover 5-1 ";name6$" "; bet6 2420 ENDPROC