Poker Game

Date: 198x
Type: Program
Platform(s): TS 1000

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10294-10335.

Related Products

Related Articles

Related Content

Image Gallery

Poker Game

Source Code

10 DIM T(13) 20 DIM E(4) 30 DIM S(4,13) 40 DIM M(5) 50 DIM N(5) 60 DIM J(5) 70 DIM F(5) 80 CLS 90 PRINT AT 0,9;"% %P%O%K%E%R% %G%A%M%E% " 100 LET P9=100 110 PRINT 120 PRINT "ON BETTING, BET A ZERO TO CALL, " 130 PRINT "A NEGATIVE NUMBER TO GO OUT." 131 PRINT 140 FOR X=1 TO 4 142 FOR I=1 TO 13 144 LET S(X,I)=0 146 NEXT I 148 NEXT X 150 PRINT TAB 5;"CARDS ARE RESHUFFLED." 160 LET A9=5 161 PRINT 162 PRINT " $5.OO ANTE"; 164 PRINT ", YOU HAVE $";P9 165 PRINT ,TAB 6;"HIT -ENTER- TO BEGIN" 167 INPUT Z$ 169 CLS 170 FOR X=1 TO 5 171 GOSUB 920 172 LET M(X)=J 173 LET N(X)=S 174 NEXT X 175 GOSUB 1040 180 PRINT 181 PRINT "I WILL PICK MY HAND." 190 FOR X=1 TO 5 192 GOSUB 920 193 LET J(X)=J 194 LET F(X)=S 196 NEXT X 200 GOSUB 1080 201 LET F=T 203 LET C2=H9 205 LET P1=-5 210 PRINT 211 PRINT "OPEN WITH A BET "; 212 INPUT B 213 PRINT B 214 IF B<0 THEN GOTO 210 216 IF RND<.2 THEN GOTO 230 220 IF INT (((T*RND)+1)+((H9*RND)+1)+(T*10))<B-(B/10) THEN GOTO 440 230 LET A9=A9+B 231 PRINT 232 PRINT "I WILL ACCEPT." 240 PRINT 241 PRINT "HOW MANY CARD(S) TO REPLACE ? "; 242 INPUT K9 243 PRINT K9 244 IF K9=0 THEN GOTO 290 250 FOR X=1 TO K9 260 PRINT 261 PRINT "CARD NUMBER "; 262 INPUT T9 263 PRINT T9 264 GOSUB 920 270 IF T9<6 THEN GOTO 280 272 PRINT "ENTER CARD NUMBER FROM 1 TO 5" 274 GOTO 260 280 LET M(T9)=J 281 LET N(T9)=S 282 NEXT X 284 GOSUB 1040 290 GOSUB 1070 292 FOR X=1 TO 5 294 LET T(M(X))=T(M(X))+1 295 LET E(N(X))=E(N(X))+1 300 NEXT X 302 GOSUB 640 304 LET P1=T 306 GOSUB 800 308 LET P2=H9 310 GOSUB 1080 312 LET H9=0 314 IF T>3 THEN GOTO 350 320 FOR Z=1 TO 5 322 IF H9=3 THEN GOTO 340 326 IF T(J(Z))<>1 THEN GOTO 340 327 LET H9=H9+1 330 GOSUB 920 331 LET J(Z)=J 332 LET F(Z)=S 340 NEXT Z 350 PRINT 351 PRINT "I WILL TAKE ";H9;" CARD(S)." 352 LET H8=H9 360 GOSUB 1080 362 LET F=T 364 GOSUB 800 366 LET C2=H9 370 LET B9=INT ((F*RND)+(C2*RND)+(F*10))+INT (A9/3)+((K9-H8)*2)+7 380 LET B1=0 382 IF RND<F*.5 THEN GOTO 390 384 LET B9=99.99 390 PRINT "HOW MUCH DO YOU BET "; 392 INPUT B 400 IF B<0 THEN GOTO 570 402 LET A9=A9+B1 410 IF B=0 THEN GOSUB 480 415 GOTO 540 420 IF A9+B<B9 THEN GOTO 460 422 IF A9+B<B9+(B9/2) THEN GOTO 450 430 IF B9=99.99 THEN GOTO 450 440 PRINT "I AM OUT" 442 GOSUB 480 444 GOTO 580 450 PRINT "I CALL" 452 LET A9=A9+B 454 GOSUB 480 456 GOTO 540 460 LET B1=INT (((B9-A9)/3)*RND)+2 461 LET A9=A9+B 470 PRINT "I RAISE $";B1 472 GOTO 390 480 PRINT "I HAD "; 482 LET T=F 484 GOSUB 820 490 PRINT "WITH A HIGH CARD OF "; 492 LET J=C2 494 GOSUB 940 496 PRINT "." 500 IF P1=-5 THEN GOTO 530 510 PRINT "YOU HAD "; 512 LET T=P1 514 GOSUB 820 520 PRINT " WITH A HIGH CARD OF "; 522 LET J=P2 524 GOSUB 940 526 PRINT "." 530 RETURN 540 IF F=P1 THEN GOTO 550 542 IF F<P1 THEN GOTO 580 550 IF C2=P2 THEN GOTO 560 552 IF C2<P2 THEN GOTO 580 560 PRINT "IT WAS A TIE" 562 GOTO 590 570 PRINT "I WON $";A9 572 LET P9=P9-A9 574 GOTO 590 580 PRINT "YOU WON $";A9 582 LET P9=P9+A9 590 PRINT 591 PRINT "AGAIN ? (Y=YES)" 592 PRINT 593 PAUSE 1000 594 IF INKEY$="Y" THEN GOTO 140 595 IF INKEY$="N" THEN GOTO 600 600 IF P9<0 THEN GOTO 630 610 IF P9>=100 THEN GOTO 620 612 IF P9<100 THEN PRINT "YOU LEFT LOSING $";100-P9 614 GOTO 1100 620 PRINT "YOU LEFT WINNING $";P9 622 GOTO 1100 630 PRINT "YOU OWE ME $";-P9 632 GOTO 1100 640 LET T=0 642 FOR I=1 TO 4 644 IF E(I)<>5 THEN GOTO 650 645 LET T=5 650 NEXT I 651 LET I=2 652 LET H9=0 660 LET I=I-1 662 IF I<>0 THEN GOTO 670 663 LET I=13 670 IF T(I)<1 THEN GOTO 660 671 LET H9=1 674 IF I<>1 THEN GOTO 680 675 LET I=14 680 LET Z=I-4 690 LET I=I-1 692 IF T(I)<>1 THEN GOTO 720 700 IF Z<>1 THEN GOTO 690 710 LET T=T+4 712 IF Z<>10 THEN GOTO 720 714 IF T=4 THEN GOTO 170 715 LET T=T+1 720 IF I=13 THEN GOTO 660 722 IF T<>5 THEN GOTO 730 724 IF T(1)<>1 THEN GOTO 730 725 LET H9=1 730 IF T=0 THEN GOTO 740 732 RETURN 740 FOR I=1 TO 13 742 IF T(I)<>4 THEN GOTO 750 743 LET T=7 750 IF T(I)<>3 THEN GOTO 760 751 LET T=T+5 752 LET H9=I 760 IF T(I)<>2 THEN GOTO 790 762 IF T=5 THEN GOTO 780 764 IF T<>0 THEN GOTO 770 765 LET H9=0 770 IF H9=1 THEN GOTO 780 772 IF H9>I THEN GOTO 780 773 LET H9=I 780 LET T=T+1 790 NEXT I 792 IF T<>5 THEN GOTO 810 793 LET T=3 796 RETURN 800 IF H9<>1 THEN GOTO 810 801 LET H9=14 810 RETURN 820 IF T=0 THEN PRINT "NOTHING" 830 IF T=1 THEN PRINT "ONE PAIR" 840 IF T=2 THEN PRINT "TWO PAIR" 850 IF T=3 THEN PRINT "THREE OF A KIND" 860 IF T=4 THEN PRINT "STRAIGHT" 870 IF T=5 THEN PRINT "FLUSH" 880 IF T=6 THEN PRINT "FULL HOUSE" 890 IF T=7 THEN PRINT "FOUR OF A KIND" 900 IF T=9 THEN PRINT "STRAIGHT FLUSH" 910 IF T=10 THEN PRINT "ROYAL FLUSH" 912 RETURN 920 LET S=INT (4*RND)+1 922 LET J=INT (13*RND)+1 930 IF S(S,J)=1 THEN GOTO 920 931 LET S(S,J)=1 934 RETURN 940 IF J=1 THEN PRINT "ACE"; 950 IF J=11 THEN PRINT "JACK"; 960 IF J=12 THEN PRINT "QUEEN"; 970 IF J=13 THEN PRINT "KING"; 980 IF J=14 THEN PRINT "ACE"; 988 IF J=9 THEN PRINT J; 989 IF J=10 THEN PRINT J; 990 IF J=2 THEN PRINT J; 992 IF J=3 THEN PRINT J; 994 IF J=4 THEN PRINT J; 995 IF J=5 THEN PRINT J; 996 IF J=6 THEN PRINT J; 997 IF J=7 THEN PRINT J; 998 IF J=8 THEN PRINT J; 999 RETURN 1000 IF S=1 THEN PRINT " OF HEARTS" 1010 IF S=2 THEN PRINT " OF SPADES" 1020 IF S=3 THEN PRINT " OF DIAMONDS" 1030 IF S=4 THEN PRINT " OF CLUBS" 1032 RETURN 1040 CLS 1042 PRINT "HERE IS YOUR HAND" 1043 PRINT 1044 FOR X=1 TO 5 1050 LET J=M(X) 1051 LET S=N(X) 1052 PRINT "CARD ";X;" IS A "; 1054 GOSUB 940 1056 GOSUB 1000 1060 NEXT X 1062 RETURN 1070 FOR X=1 TO 4 1072 LET E(X)=0 1074 NEXT X 1076 FOR X=1 TO 13 1077 LET T(X)=0 1078 NEXT X 1079 RETURN 1080 GOSUB 1070 1082 FOR X=1 TO 5 1084 LET T(J(X))=T(J(X))+1 1090 LET E(F(X))=E(F(X))+1 1092 NEXT X 1094 GOSUB 640 1096 RETURN 1100 STOP 1110 CLEAR 1120 SAVE "1031%4" 1130 RUN

People

No people associated with this content.

Scroll to Top