10REM CRAPS
20REM By Jonathan Ripley
30ONERRORRUN
40MODE7
50VDU23,1,0;0;0;0;0;
60PROCinit
70PROCins
80MODE5
90VDU23,1,0;0;0;0;0;
100PROCplay
110END
120DEFPROCins
130CLS
140PRINTTAB(17,2)"CRAPS"TAB(17,3)"----
-"TAB(2,5)"THE GAME OF CRAPS IS PLAYED W
ITH TWO DICE. FIRST YOU BET AND THEN YO
U THROW IF YOU GET A SCORE OF 7 OR 11 Y
OU WIN. BUT IF YOU THROW A 2, 3 OR 12 Y
OU LOSE."
150PRINT'" YOU KEEP ON THROWING UNTIL
YOU THROW THE SAME NUMBER YOU DID FIRS
T TIME (AND WIN) OR THROW A SEVEN (AND L
OSE)."
160PROCcont
170CLS
180ENDPROC
190DEFPROCinit
200VDU23,224,0,0,255,255,0,0,0,0
210VDU23,225,48,48,48,48,48,48,48,48
220VDU23,226,0,0,0,0,255,255,0,0
230VDU23,227,0,0,248,252,12,12,12,12
240VDU23,228,0,0,31,63,48,48,48,48
250VDU23,229,12,12,12,12,252,248,0,0
260VDU23,230,48,48,48,48,63,31,0,0
270VDU23,231,12,12,12,12,12,12,12,12
280money=500
290A$=STRING$(3," ")+CHR$228+STRING$(3
,CHR$224)+CHR$227+STRING$(4," ")+CHR$228
+STRING$(3,CHR$224)+CHR$227
300B$=STRING$(3," ")+CHR$225+STRING$(3
," ")+CHR$231+STRING$(4," ")+CHR$225+STR
ING$(3," ")+CHR$231
310C$=STRING$(3," ")+CHR$230+STRING$(3
,CHR$226)+CHR$229+STRING$(4," ")+CHR$230
+STRING$(3,CHR$226)+CHR$229
320T=0
330S=0
340M=0
350OK=0
360ENDPROC
370DEFPROCcont
380PRINTTAB(7,24)"PRESS SPACE TO CONTI
NUE";
390REPEATUNTILGET=32
400ENDPROC
410DEFPROCplay
420PRINTTAB(7,2)"CRAPS"TAB(7,3)"-----"
430PRINTTAB(0,5)"CAPITAL=£";money
440PROCdie
450REPEAT
460bet=FNbet
470M=0
480REPEAT
490PROCroll
500PROCcheck
510FORD=0TO200:NEXT
520IF OK=0 PRINTTAB(0,16)"TAP SPACE TO
ROLL...":REPEATUNTILGET=32
530PRINTTAB(0,16)STRING$(20," ")
540UNTILOK=1
550OK=0
560PRINTTAB(0,7)STRING$(20," ")
570M=0
580PRINTTAB(9,5)STRING$(11," ")TAB(9,5
);money
590UNTILmoney=0
600PROCend
610ENDPROC
620DEFPROCroll
630FORthrow=0TORND(20)+20
640SOUND1,-15,RND(100)+50,1
650A=RND(6)
660B=RND(6)
670PRINTTAB(5,11);A
680PRINTTAB(14,11);B
690NEXT
700C=A+B
710ENDPROC
720DEFPROCdie
730PRINTTAB(0,9);A$'B$'B$'B$'C$
740ENDPROC
750DEFFNbet
760REPEAT
770PRINTTAB(0,22)"NEXT BET:£";STRING$(
100," ")
780INPUTTAB(10,22)""bet
790IF bet>money VDU7:PRINTTAB(0,16)"YO
U CAN'T AFFORD IT!"
800IF bet<1 VDU7:PRINTTAB(0,16)" T
OO SMALL "
810UNTIL bet>0 AND money>=bet
820=bet
830DEFPROCcheck
840IF T=0 AND (C=7 OR C=11) PROCwin:S=
1:OK=1
850IF T=0 AND (C=2 OR C=3 OR C=12) PRO
Close:S=1:OK=1
860IF T=0 AND S=0 PRINTTAB(0,7)"MAKING
";C;" BEFORE 7":M=C
870IF T>0 AND C=7 PROClose:OK=1
880IF T>0 AND C=M PROCwin:OK=1
890T=T+1
900IF M=-1 T=0
910IF OK=1 M=0
920S=0
930ENDPROC
940DEFPROCwin
950PRINTTAB(0,16)" GOOD WIN!
"
960money=money+bet
970T=-1
980FORloop=0TO250STEP12.5
990SOUND1,-15,loop,2
1000NEXT
1010IF money>1500000 PROCbroke
1020ENDPROC
1030DEFPROClose
1040PRINTTAB(0,16)"BAD LUCK! YOU LOSE!"
1050money=money-bet
1060T=-1
1070FORloop=250TO0STEP-12.5
1080SOUND1,-15,loop,2
1090NEXT
1100ENDPROC
1110DEFPROCend
1120CLS
1130PRINTTAB(6,2)"CRAPS"TAB(6,3)"-----"
1140PRINTTAB(3,5)"YOU'RE BROKE!"
1150PRINTTAB(0,9)"ANOTHER GO:Y/N ";
1160REPEAT
1170G$=GET$
1180UNTILINSTR("YNyn",G$,0)>0
1190IF INSTR("Yy",G$,0) PRINT"YES":PROC
replay:ENDPROC
1200IF INSTR("Nn",G$,0) PRINT"NO"
1210VDU22,7
1220REM CALL&8023
1225END
1230DEFPROCbroke
1240CLS
1250PRINTTAB(6,2)"CRAPS"TAB(6,3)"-----"
1260FORX=0TO255STEP5
1270SOUND1,-15,X,2
1280NEXT
1290PRINTTAB(4,6);"WELL DONE!"'" YOU BR
OKE THE BANK"
1300PRINTTAB(0,9)"ANOTHER GO:Y/N ";
1310G$=GET$
1320UNTILINSTR("YNyn",G$,0)>0
1330IF INSTR("Yy",G$,0) PROCreplay:ENDP
ROC
1340IF INSTR("Nn",G$,0) PRINT"NO"
1350VDU22,7
1360REM CALL&8023
1365END
1370DEFPROCreplay
1380PROCinit
1390PRINTTAB(5,30)"TAP SPACE";
1400REPEATUNTILGET=32
1410CLS
1420PROCplay
1430ENDPROC