10 PRINT TAB(26);"BACCARAT"
20 PRINT
30 PRINT
40 PRINT "BACCARAT -- CHEMIN DE FER"
50 PRINT
60 PRINT "DO YOU NEED INSTRUCTIONS (Y/N)";
70 INPUT Q$
80 IF Q$<>"y" THEN IF Q$<>"Y" THEN 210
90 PRINT "   BACCARAT IS A VERY POPULAR GAME IN LAS"
100 PRINT"VEGAS. THE PLAYER AND BANKER EACH RECEIVE"
110 PRINT"TWO CARDS FROM A 'SHOE' CONTAINING 8 DECKS"
120 PRINT"OF CARDS. ALL CARD COMBINATIONS TOTALING"
130 PRINT"TEN ARE NOT COUNTED. THE ONE THAT ENDS UP"
140 PRINT"CLOSER TO NINE WINS. THE STAKES ARE HIGH;"
150 PRINT"ALL OF THE PLAYERS START WITH TEN THOUSAND"
160 PRINT"DOLLARS. YOU CAN BET ON THE DEALER OR THE"
170 PRINT"PLAYER. A THIRD CARD IS GIVEN ONLY UNDER"
180 PRINT"CERTAIN CONDITIONS, AS YOU WILL SEE. LET"
190 PRINT"US BEGIN.   GOOD LUCK!!"
200 PRINT
210 DIM M(20),F1(20),F(20),B$(13),V(13),G$(20)
220 DIM Z(9,10),Q(4,13)
230 FOR X=3 TO 6
240   FOR Y=1 TO 10
250     READ Z(X,Y)
260 NEXT Y,X
270 FOR S1=1 TO 10:READ W(S1):NEXT
280 FOR S1=1 TO 4:READ A$(S1):NEXT
290 FOR S1=1 TO 13:READ B$(S1):NEXT
300 FOR S1=1 TO 13:READ V(S1):NEXT
310 PRINT
320 INPUT "ENTER NUMBER FROM 1 TO 10000";X
330 RANDOMIZE X
340 PRINT
350 PRINT"HOW MANY PLAYERS";
360 INPUT P1
370 FOR J=1 TO P1
380   PRINT"WHAT IS THE NAME OF PLAYER"J;
390   INPUT G$(J)
400   M(J)=10000
410 NEXT J
420 FOR S1=1 TO 4
430   FOR S2=1 TO 13
440     Q(S1,S2)=0
450   NEXT S2
460 NEXT S1
470 FOR J=1 TO 6
480   C=INT(1+RND(1)*4)
490   D=INT(1+RND(1)*13)
500   Q(C,D)=Q(C,D)+1
510   IF Q(C,D)>=32 THEN 480
520   B(J)=V(D)
530   C$(J)=B$(D)+" OF "+A$(C)
540 NEXT J
550 W1=2
560 FOR J=1 TO P1
570   IF M(J)<1 THEN 670
580   PRINT G$(J)" HAS $"M(J)".  BET";
590   INPUT F(J)
600   IF F(J)>M(J) THEN 580
610   IF F(J)<>INT(F(J)) THEN 580
620   IF F(J)<1 THEN 580
630   PRINT"(1) BANKER OR (2) PLAYER";
640   INPUT F1(J)
650   IF F1(J)>=1000 THEN 580
660   IF (F1(J)-1)*(F1(J)-2)<>0 THEN 630
670 NEXT J
680 J=0
690 T1=B(1)+B(2)
700 T2=B(3)=B(4)
710 PRINT
720 PRINT"BANKER"TAB(20)"PLAYER"
730 PRINT C$(3)TAB(20)C$(1)
740 PRINT C$(4)TAB(20)C$(2)
750 IF T1<10 THEN 770
760 T1=T1-10
770 IF T2<10 THEN 790
780 T2=T2-10
790 IF W(T1+1)=0 THEN 860
800 PRINT"PLAYER MUST DRAW."
810 PRINT C$(5)
820 T1=T1+B(5)
830 IF T1<10 THEN 860
840 T1=T1-10
850 GOTO 880
860 PRINT"PLAYER CANNOT DRAW."
870 J=11
880 PRINT"PLAYERS TOTAL:"T1
890 PRINT
900 IF T2<3 THEN 960
910 IF T2>6 THEN 1020
920 IF J<>11 THEN 950
930 IF T2=6 THEN 1020
940 GOTO 960
950 IF Z(T2,B(5)+1)=0 THEN 1020
960 PRINT"BANKER MUST DRAW."
970 PRINT C$(6)
980 T2=T2+B(6)
990 IF T2<10 THEN 1010
1000 T2=T2-10
1010 GOTO 1030
1020 PRINT"BANKER CANNOT DRAW."
1030 PRINT"BANKERS TOTAL:"T2
1040 PRINT
1050 IF T2<>T1 THEN 1080
1060 PRINT"IT'S A TIE. THE HAND IS PLAYED OVER."
1070 GOTO 470
1080 IF T2<T1 THEN 1120
1090 W1=1
1100 PRINT"BANKER WINS!!"
1110 GOTO 1130
1120 PRINT"PLAYER WINS!!"
1130 FOR J=1 TO P1
1140   IF M(J)<=0 THEN 1220
1150   PRINT G$(J)" ";
1160   IF F1(J)=W1 THEN 1200
1170   M(J)=M(J)-F(J)
1180   PRINT"LOSES $"F(J)", FOR A TOTAL OF $"M(J)"."
1190   GOTO 1220
1200   M(J)=M(J)+F(J)
1210   PRINT"WINS $"F(J)", FOR A TOTAL OF $"M(J)"."
1220 NEXT J
1230 FOR J=1 TO P1
1240   IF M(J)<>0 THEN 1280
1250 NEXT J
1260 PRINT"THANK YOU FOR YOUR MONEY, AND ";
1270 GOTO 1410
1280 PRINT
1290 PRINT"-------- NEW GAME --------"
1300 PRINT
1310 FOR X=1 TO 4
1320 FOR Y=1 TO 13
1330   IF Q(X,Y)<>8 THEN 470
1340 NEXT Y,X
1350 GOTO 420
1360 DATA 1,1,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,0,0
1370 DATA 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0
1380 DATA 1,1,1,1,1,1,0,0,0,0,SPADES,HEARTS,DIAMONDS
1390 DATA CLUBS,ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT
1400 DATA NINE,TEN,JACK,QUEEN,KING,1,2,3,4,5,6,7,8,9,0,0,0,0
1410 PRINT"THANK YOU FOR PLAYING."
1420 END
