10 REM POKER modified for OSBORNE by Jack Campin 8/1985.
15 REM This version has primitive graphics and randomising but should work
16 REM on any OSBORNE.
20 CLEAR 200:DIM A$(13):DEFINT A,D,Q,I,X,Y
30 REM
40 REM
50 PRINT CHR$(26);
60 C=20
70 X=10:Y=6:GOSUB 2140:PRINT"*** POKER ***"
80 FOR Q=1 TO 13:READ A$(Q):NEXT:FOR Q=0 TO 8:READ P(Q):NEXT
90 DATA A,2,3,4,5,6,7,8,9,10,J,Q,K,1,2,3,5,7,10,40,100,400
100 PRINT:PRINT TAB(8)"DO YOU WANT INSTRUCTIONS Y/N?
110 PRINT:PRINT TAB(10)"ENGAGE CAPS LOCK!
120 GOSUB 2160
130 IF A$="Y" THEN GOSUB 1310:GOTO 160
140 IF ASC(A$)>96 THEN 110
150 IF A$<>"N" THEN 120
160 PRINT CHR$(26):X=3:Y=12:GOSUB 2140
170 RANDOMIZE
180 GOTO 210
190 RANDOMIZE:C=20
200 FOR Q=0 TO 4:A(Q)=0:B(Q)=0:D(Q)=0:V(Q)=0:NEXT:M=0
210 GOSUB 1540 'select cards
220 PRINT CHR$(26);
230 GOSUB 2110
240 X=3:Y=2:GOSUB 2140:PRINT"PAYOUTS:";
250 FOR I=1 TO 9:ON I GOTO 260,270,280,290,300,310,320,330,340
260 PRINT"  HIGH PAIR -";:GOTO 350
270 PRINT TAB(14)"TWO PAIR-";:GOTO 350
280 PRINT TAB(14)"3 OF A KIND -";:GOTO 350
290 PRINT TAB(14)"STRAIGHT -";:GOTO 350
300 PRINT TAB(14)"FLUSH -";:GOTO 350
310 PRINT TAB(14)"FULL HOUSE -";:GOTO 350
320 PRINT TAB(14)"4 OF A KIND -";:GOTO 350
330 PRINT TAB(14)"STRAIGHT FLUSH -";:GOTO 350
340 PRINT TAB(14)"ROYAL FLUSH -";:GOTO 350
350 PRINT TAB(32) USING"### TO 1";P(I-1):NEXT
360 X=3:Y=12:GOSUB 2140:PRINT"PRESS [B] TO BET OR [D] TO DRAW"
370 F=0:FOR Q=0 TO 4:GOSUB 1680:NEXT Q
380 F=0:FOR Q=0 TO 4:GOSUB 1800:NEXT Q
390 GOSUB 2160:IF A$="D"THEN 430
400 IF A$<>"B"THEN 390
410 IF M>98 THEN 390
420 IF C>0 THEN C=C-1:M=M+1:GOSUB 2110:GOTO 390
430 IF C=0 AND M=0 THEN 2160
440 IF M=0 THEN 390
450 F=8:FOR Q=0 TO 4:GOSUB 1800:GOSUB 1870:NEXT
460 X=3:Y=12:GOSUB 2140
470 PRINT"PRESS [1] TO [5] TO HOLD OR [S] TO SIT OR [D] TO DRAW:"
480 GOSUB 2160
490 'IF A$="C"THEN FOR I=0 TO 4:V(I)=0:NEXT:X=3:Y=11:GOSUB 1540:PRINT STRING$(78,32):GOTO 750
500 IF A$="S"THEN 610
510 IF A$="D"THEN 550
520 IF A$<"1" OR A$>"5"THEN 480
530 A=VAL(A$)
540 V(A-1)=1:X=(A-1)*16+5:Y=21:GOSUB 2140:PRINT"HELD";:GOTO 480
550 FOR Q=0 TO 4:IF V(Q)=0 THEN B(Q)=Q+1:F=0:GOSUB 1800
560 NEXT:'FORI=1TO500:NEXT
570 X=0:Y=21:GOSUB 2140:PRINT STRING$(78,32);
580 X=0:Y=12:GOSUB 2140:PRINT STRING$(78,32)
590 FOR Q=0 TO 4:IF V(Q)=0 THEN F=0:GOSUB 1560:GOSUB 1620:F=8:GOSUB 1800:GOSUB 1870
600 NEXT
610 REM Put cards in order
620 FOR I=1 TO 4:FOR J=0 TO I-1
630 IF A(J)> A(I) THEN K=A(I):A(I)=A(J):A(J)=K
640 NEXT J
650 NEXT I
660 REM Check for wins
670 X=0:Y=20:GOSUB 2140:PRINT STRING$(78,32)
680 X=0:Y=11:GOSUB 2140:PRINT STRING$(78,32)
690 T=1:V=0
700 ON T GOSUB 730,760,800,870,900
710 IF V=0 THEN T=T+1:IF T<>6 THEN 700
720 GOTO 930
730 IF A(0)=A(1) AND A(1)=A(2) AND A(2)=A(3) THEN V=1
740 IF A(1)=A(2) AND A(2)=A(3) AND A(3)=A(4) THEN V=1
750 RETURN
760 IF A(0)=A(1) AND A(1)=A(2) THEN V=2:IF A(3)=A(4) THEN V=V+1
770 IF A(1)=A(2) AND A(2)=A(3) THEN V=2
780 IF A(2)=A(3) AND A(3)=A(4) THEN V=2:IF A(0)=A(1) THEN V=V+1
790 RETURN
800 P=0:IF A(0)=A(1) THEN P=P+1:N=A(0)
810 IF A(1)=A(2) THEN P=P+1:N=A(1)
820 IF A(2)=A(3) THEN P=P+1:N=A(2)
830 IF A(3)=A(4) THEN P=P+1:N=A(3)
840 IF P=2 THEN V=4
850 IF P=1 AND (N>10 OR N=1)THEN V=7
860 RETURN
870 IF D(0)=D(1) AND D(1)=D(2) AND D(2)=D(3) AND D(3)=D(4) THEN V=5:GOSUB 900
880 IF V=6 THEN V=8
890 RETURN
900 IF A(0)+1=A(1) AND A(1)+1=A(2) AND A(2)+1=A(3) AND A(3)+1=A(4) THEN V=V+6
910 IF A(0)=1 AND A(1)+A(2)+A(3)+A(4)=46 THEN V=6
920 RETURN
930 IF V>0 THEN 960 ELSE IF C=0 THEN 1260
940 X=3:Y=12:GOSUB 2140:PRINT"YOU LOST. PRESS ANY KEY TO CONTINUE:
950 X=0:Y=12:GOSUB 2140:PRINT STRING$(78,32):GOSUB 2160:GOTO 200
960 X=3:Y=21:GOSUB 2140:ON V GOTO 970,980,990,1000,1010,1020,1030,1040,20,20,1050
970 PRINT"FOUR OF A KIND";:E=P(6)*M:GOTO 1060
980 PRINT "THREE OF A KIND";:E=P(2)*M:GOTO 1060
990 PRINT "FULL HOUSE";:E=P(5)*M:GOTO 1060
1000 PRINT "TWO PAIR";:E=P(1)*M:GOTO 1060
1010 PRINT "FLUSH";:E=P(4)*M:GOTO 1060
1020 PRINT "STRAIGHT";:E=P(3)*M:GOTO 1060
1030 PRINT "HIGH PAIR";:E=M:GOTO 1060
1040 PRINT "ROYAL FLUSH";:E=P(8)*M:GOTO 1060
1050 PRINT "STRAIGHT FLUSH";:E=P(7)*M:GOTO 1060
1060 PRINT ". YOU HAVE WON"E;
1070 X=3:Y=12:GOSUB 2140:PRINT"PRESS [C] TO COLLECT OR [D] TO DOUBLE:
1080 GOSUB 2160
1090 IF A$="D" THEN 1140
1100 IF A$<>"C" THEN 1080 ELSE I=0:B=C+E
1110 C=C+1:PRINT CHR$(7):I=I+1:GOSUB 2110
1120 IF I<20 THEN FOR J=1 TO 300:NEXT ELSE IF I>60 THEN C=B:GOTO 200
1130 IF C<B GOTO 1110 ELSE 200
1140 PRINT CHR$(26);
1150 GOSUB 2110
1160 X=4:Y=6:GOSUB 2140:PRINT "PRESS [B] OR [S] SMALLER THAN 8";
1170 Q=2:F=0:GOSUB 1680:GOSUB 1800:GOSUB 1560
1180 GOSUB 2160
1190 IF A$<>"B" AND A$<>"S" THEN 1180
1200 F=8:GOSUB 1800:GOSUB 1870:X=13:Y=8:GOSUB 2140:PRINT "YOU BET ";:IF A$="B" THEN PRINT "BIGGER" ELSE PRINT "SMALLER"
1210 IF A$="B" AND(A(2)>8 OR A(2)=1) THEN 1240
1220 IF A$="S" AND A(2)<8 THEN 1240
1230 X=9:Y=10:GOSUB 2140:PRINT "BAD LUCK!    YOU LOST":IF C<1 THEN 1260 ELSE 940
1240 X=3:Y=10:GOSUB 2140:PRINT "CONGRATULATIONS! YOU HAVE WON"E*2:E=E*2:GOTO 1070
1250 REM Finish routine
1260 X=3:Y=12:GOSUB 2140:PRINT"TOO BAD. BETTER LUCK NEXT TIME. DO YOU WANT ANOTHER GO Y/N?
1270 GOSUB 2160
1280 IF A$="Y" THEN PRINT CHR$(26):GOTO 190 ELSE IF A$<>"N" THEN 1270
1290 GOTO 2180
1300 REM Instructions
1310 PRINT CHR$(26);
1320 PRINT TAB(12)"*** POKER ***"
1330 PRINT:PRINT "This game is very simple to play.
1340 PRINT
1350 PRINT"You start with"C"credits and you bet on each hand.
1360 PRINT
1370 PRINT"Maximum bet is the amount of your credits or 98.
1380 PRINT
1390 PRINT"You then draw your cards and select the cards you want to hold.
1400 PRINT
1410 PRINT"Then you draw cards again and you are told if you have won.
1420 PRINT
1430 PRINT"If you win you then have the choice of collecting your winnings or
1440 PRINT"taking a chance to double them by guessing whether a single card is
1450 PRINT"higher or lower than 8 (you lose if it is an 8).
1460 PRINT
1470 PRINT"Play comtinues until you are out of credits.
1480 PRINT
1490 PRINT TAB(10)"Press [RETURN] to begin"
1500 GOSUB 2160:IF A$<>CHR$(13) THEN 1500
1510 PRINT CHR$(26);
1520 RETURN
1530 REM Select 5 cards
1540 FOR Q=0 TO 4:GOSUB 1560:GOSUB 1620:NEXT Q
1550 RETURN
1560 REM Card selection
1570 A(Q)=RND*12+1
1580 D(Q)=RND*3+1
1590 'IF D(Q)>4 THEN D(Q)=D(Q)/2
1600 B(Q)=A(Q)+D(Q)*20
1610 RETURN
1620 REM Card check
1630 FOR I=0 TO 4
1640 IF I=Q THEN 1660
1650 IF B(I)=B(Q) THEN GOSUB 1570:GOTO 1630
1660 NEXT I
1670 RETURN
1680 REM Draw card outline
1690 W=16:G=11
1700 X=Q*16+1:Y=14:GOSUB 2140
1710 REM
1720 PRINT CHR$(45);STRING$(11,45);CHR$(45);
1730 FOR L=15 TO 20:X=Q*16+1:Y=L:GOSUB 2140
1740 PRINT CHR$(124);STRING$(11,32);CHR$(124)
1750 NEXT L
1760 X=Q*16+1:Y=20:GOSUB 2140
1770 PRINT CHR$(45);STRING$(11,45);CHR$(45);
1790 RETURN
1800 REM Fill in card
1810 FOR I=15 TO 19:X=Q*16+2:Y=I:GOSUB 2140
1820 IF F=8 THEN 1840
1830 PRINT STRING$(11,42):GOTO 1850
1840 PRINT STRING$(11,32)
1850 NEXT I
1860 RETURN
1870 REM Print the card value
1880 ON D(Q) GOTO 1900,1950,2000,2050
1890 RETURN
1900 X=Q*16+5:Y=17:GOSUB 2140:PRINT"HEART
1910 X=Q*16+3:Y=19:GOSUB 2140:PRINT USING"\\";A$(A(Q))
1920 X=Q*16+10:Y=15:GOSUB 2140
1930 IF A(Q)<>10 THEN PRINT USING" !";A$(A(Q)) ELSE PRINT"10";
1940 RETURN
1950 X=Q*16+5:Y=17:GOSUB 2140:PRINT"SPADE
1960 X=Q*16+3:Y=19:GOSUB 2140:PRINT USING"\\";A$(A(Q))
1970 X=Q*16+10:Y=15:GOSUB 2140
1980 IF A(Q)<>10 THEN PRINT USING" !";A$(A(Q)) ELSE PRINT "10";
1990 RETURN
2000 X=Q*16+5:Y=17:GOSUB 2140:PRINT"CLUBS"
2010 X=Q*16+3:Y=19:GOSUB 2140:PRINT USING"\\";A$(A(Q))
2020 X=Q*16+10:Y=15:GOSUB 2140
2030 IF A(Q)<>10 THEN PRINT USING" !";A$(A(Q)) ELSE PRINT"10";
2040 RETURN
2050 X=Q*16+4:Y=17:GOSUB 2140:PRINT"DIAMOND
2060 X=Q*16+3:Y=19:GOSUB 2140:PRINT USING"\\";A$(A(Q))
2070 X=Q*16+10:Y=15:GOSUB 2140
2080 IF A(Q)<>10 THEN PRINT USING" !";A$(A(Q)) ELSE PRINT"10";
2090 RETURN
2100 REM Update bets & credits
2110 C$="CREDITS ###,###":IF C>999999! THEN C=C-1000000#
2120 X=9:Y=0:GOSUB 2140:PRINT USING"BETS ##";M;
2130 X=33:Y=0:GOSUB 2140:PRINT USING C$;C:RETURN
2140 PRINT CHR$(27)+"="+CHR$(32+Y)+CHR$(32+X);:RETURN 'Cursor posn.
2150 REM Inkey routine
2160 A$=INKEY$:IF A$=""THEN 2160
2170 RETURN
2180 PRINT CHR$(26):PRINT"GOODBYE
2190 REM
sor posn.
2150 REM Inkey routine
2160 A$=INKEY$:IF A$=""THEN 2160
2170 RETURN
2180 PRINT CHR$(26):PRINT"GOODB