10 REM Roul5 20 REM by Graham Kendall 30 : 40 GOSUB 130 : REM Init_1 Routine 50 WHILE NEWGAME% = 0 60 GOSUB 180 :REM Init_2 Routine 70 GOSUB 1060 :REM Spin Wheel Routine 80 GOSUB 6000 :REM Wait for Space Routine 90 GOSUB 7000 :REM Ask Question Routine 100 WEND 110 END 120 : 130 REM Init_1 Routine 140 NEWGAME% = 0 150 DIM SPINTABLE%(36),BETCTRL%(36,5) 160 RETURN 170 : 180 REM Init_2 Routine 190 NOOFSPINS% = 0:MONEY% = 0 :WINS% = 0 : LOSSES% = 0 200 GOSUB 330 :REM Number of Spins Routine 210 GOSUB 430 :REM How Many Spins Before monitor Routine 220 GOSUB 520 :REM How Many Spins to Monitor a Number Routine 230 GOSUB 620 :REM How Many bets on a number routine 240 GOSUB 720 :REM Initial Screen Routine 250 FOR I% = 0 TO 36 260 SPINTABLE%(I%) = 0 270 BETCTRL%(I%,1) = -1 280 BETCTRL%(I%,2) = 2 290 NEXT I% 300 LASTWIN$ = "" 310 RETURN 320 : 330 REM Number of Spins Routine 340 WHILE (NOOFSPINS% < 100) OR (NOOFSPINS% > 5000) 350 CLS:GOSUB 6500 :REM Print Heading Routine 360 TEXT$ = "How many Spins would you like the wheel to make (100 - 5000)" 370 DOWN% = 10:GOSUB 5000 :REM Centre Text Routine 380 INPUT NOOFSPINS% 390 WEND 400 RETURN 410 : 420 REM How Many Spins Before Monitor Routine 430 SPINSB4MONITOR% = 0 440 WHILE (SPINSB4MONITOR% < 10) OR (SPINSB4MONITOR% > 100) 450 CLS:GOSUB 6500 :REM Print Heading Routine 460 TEXT$ = "How many Spins would you like made before monitoring (10 - 100)" 470 DOWN% = 10:GOSUB 5000 :REM Centre Text Routine 480 INPUT SPINSB4MONITOR% 490 WEND 500 RETURN 510 : 520 REM How Many Spins to Monitor a Number Routine 530 MONITORTIME% = 0 540 WHILE (MONITORTIME% < 10) OR (MONITORTIME% > 100) 550 CLS:GOSUB 6500 :REM Print Heading Routine 560 TEXT$ = "How many Spins should a number to be monitored for (10 - 100)" 570 DOWN% = 10:GOSUB 5000 :REM Centre Text Routine 580 INPUT MONITORTIME% 590 WEND 600 RETURN 610 : 620 REM How Many Bets Routine 630 BETTIME% = 0 640 WHILE (BETTIME% < 1) OR (BETTIME% > 50) 650 CLS:GOSUB 6500 :REM Print Heading Routine 660 TEXT$ = "How many Bets would you like to make on one number (1 - 50)" 670 DOWN% = 10:GOSUB 5000 :REM Centre Text Routine 680 INPUT BETTIME% 690 WEND 700 RETURN 710 : 720 REM Initial Screen Routine 730 CLS:GOSUB 6500 :REM Print Heading Routine 740 ACROSS% = 5 :REM Used for all prints in this routine 750 TEXT$ = LEFT$("Number of spins before monitoring " + STRING$(45," "),45) 760 TEXT$ = TEXT$ + "=" + STR$(SPINSB4MONITOR%) 770 DOWN% = 4:GOSUB 5500 :REM Print Text Routine 780 TEXT$ = LEFT$("Number of spins a number is monitored for " + STRING$(45," "),45) 790 TEXT$ = TEXT$ + + "=" + STR$(MONITORTIME%) 800 DOWN% = 5:GOSUB 5500 :REM Print Text Routine 810 TEXT$ = LEFT$("Number of times a number will be bet upon " + STRING$(45," "),45) 820 TEXT$ = TEXT$ + + "=" + STR$(BETTIME%) 830 DOWN% = 6:GOSUB 5500 :REM Print Text Routine 840 RETURN 850 : 860 REM Update Screen Routine 870 TEXT$ = "Monitoring " 880 DOWN% = 8:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 890 TEXT$ = LEFT$(MONITORNUMS$ + STRING$(79," "),79) 900 DOWN% = 9:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 910 TEXT$ = "Betting on" 920 DOWN% = 11:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 930 TEXT$ = LEFT$(BETNUMS$ + STRING$(79," "),79) 940 DOWN% = 12:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 950 TEXT$ = LEFT$("Bank Stands at " + STR$(MONEY%) + STRING$(70," "),70) 960 DOWN% = 14:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 970 TEXT$ = "Number of Losses =" + STR$(LOSSES%) 980 DOWN% = 16:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 990 TEXT$ = "Number of Wins =" + STR$(WINS%) 1000 DOWN% = 18:ACROSS% = 2:GOSUB 5500 :REM Print Text Routine 1010 TEXT$ = LEFT$("Last Winning Number =" + LASTWIN$ + STRING$(70," "),70) 1020 DOWN% = 20:ACROSS% = 2 1030 GOSUB 5500 :REM Print Text Routine 1040 RETURN 1050 : 1060 REM Spin Wheel Routine 1070 FOR SPINCNT% = 1 TO NOOFSPINS% 1080 IF SPINCNT% = INT(SPINCNT%/20)*20 THEN TEXT$ = "Up to Spin " + STR$(SPINCNT%) + " of" + STR$(NOOFSPINS%):DOWN% =22:GOSUB 5000 :REM Centre Text Routine 1090 GOSUB 7500 :REM Random Number Routine 1100 IF (SPINCNT% - SPINTABLE%(NUM%)) >SPINSB4MONITOR% AND BETCTRL%(NUM%,1) <1 THEN BETCTRL%(NUM%,1) = 0 :REM Now Monitoring Number 1110 SPINTABLE%(NUM%) = SPINCNT% 1120 IF BETCTRL%(NUM%,1) = 0 THEN GOSUB 1220 :REM Monitor Numbers Routine 1130 MONITORNUMS$ = "" : BETNUMS$ = "" 1140 FOR R% = 0 TO 36 1150 IF BETCTRL%(R%,1) = 0 THEN GOSUB 1440 :REM Keep Monitoring Routine 1160 IF BETCTRL%(R%,1) = 1 AND BETCTRL%(R%,5) < SPINCNT% THEN GOSUB 1290 :REM Bet Routine 1170 NEXT R% 1180 GOSUB 860 :REM Update Screen Routine 1190 NEXT SPINCNT% 1200 RETURN 1210 : 1220 REM Monitor Numbers Routine 1230 X% = BETCTRL%(NUM%,2): X% = X% +1 1240 BETCTRL%(NUM%,2) = X% 1250 BETCTRL%(NUM%,X%) = SPINCNT% 1260 IF X% = 5 THEN BETCTRL%(NUM%,1) = 1 :REM Now Betting on Number 1270 RETURN 1280 : 1290 REM Bet Routine 1300 MONEY% = MONEY% -10 1310 IF NUM% = R% THEN WINS% = WINS% +1:MONEY% = MONEY% +360:LASTWIN$ = STR$(R%) ELSE LOSSES% = LOSSES% +1 1320 IF SPINCNT% - BETCTRL%(R%,5) = BETTIME% THEN RESETNUM% = R%:GOSUB 1360:REM Reset Bet Control Routine 1330 BETNUMS$ = BETNUMS$ + STR$(R%) 1340 RETURN 1350 : 1360 REM Reset Bet Control Routine 1370 BETCTRL%(RESETNUM%,1) = -1 1380 BETCTRL%(RESETNUM%,2) = 2 1390 BETCTRL%(RESETNUM%,3) = 0 1400 BETCTRL%(RESETNUM%,4) = 0 1410 BETCTRL%(RESETNUM%,5) = 0 1420 RETURN 1430 : 1440 REM Keep Monitoring Routine 1450 IF SPINCNT% - BETCTRL%(R%,3) >=MONITORTIME% THEN RESETNUM% = R%:GOSUB 1360 1460 IF BETCTRL%(R%,1) = 0 THEN MONITORNUMS$ = MONITORNUMS$ + STR$(R%) 1470 RETURN 1480 : 5000 REM Print Centred Text Routine 5010 PRINT CHR$(11) 5020 FOR I% = 1 TO DOWN% -1:PRINT CHR$(10);:NEXT 5030 ACROSS% = (79-LEN(TEXT$))/2 5040 PRINT TAB(ACROSS%);TEXT$ 5050 RETURN 5060 : 5500 REM Print Text on Screen Routine 5510 PRINT CHR$(11) 5520 FOR I% = 1 TO DOWN% -1:PRINT CHR$(10);:NEXT 5530 PRINT TAB(ACROSS%);TEXT$ 5540 RETURN 5550 : 6000 REM Press Space Routine 6010 TEXT$ = "Press Space to Continue" 6020 DOWN% = 22:GOSUB 5000 : REM Centre Text Routine 6030 WHILE INKEY$ <> " " 6040 WEND 6050 RETURN 6060 : 6500 REM Print Heading Routine 6510 TEXT$ = "Roulette Program 5" 6520 DOWN% = 2:GOSUB 5000 : REM Centre Text Routine 6530 RETURN 6540 : 7000 REM Ask Question Routine 7010 A% = 0 7020 WHILE A% = 0:CLS:GOSUB 6500 :REM Print Heading Routine 7030 TEXT$ = "Do you want to play again?" 7040 DOWN% = 10:GOSUB 5000 :REM Centre Text Routine 7050 A$ = "" 7060 WHILE INSTR(" YyNn",A$) <2 7070 A$=INKEY$ 7080 WEND 7090 A%=INSTR("YyNn",A$) 7100 WEND 7110 IF A%=3 OR A%=4 THEN NEWGAME% = -1 7120 RETURN 7130 : 7500 REM Random Number Routine 7510 RANDOMIZE TIMER 7520 NUM% = INT(RND*(36+1)) 7530 RETURN 7540 :