home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_06_(08-1984).d64
/
poker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
6KB
|
169 lines
100 REM DRAW POKER
110 REM BY EARL WUCHTER 1978
120 REM ANYONE FOR COLOR & SOUND ???
130 POKE53272,21:PRINT"[147] D R[160]A[160]W P O K E R"
140 PRINTTAB(10)"EARL WUCHTER[160]1978"
150 INPUT"MY NAME IS DEALER. WHAT IS YOURS MAN[157][157][157][157][157]";UN$
160 IFLEN(UN$)>8THENUN$=LEFT$(UN$,8)
170 POKE53272,23:PRINT"[147][207][203]. "UN$" [200][197][210][197][160][193][210][197][160][212][200][197][160][200][207][213][211][197] [210][213][204][197][211]:"
180 PRINT"[212][200][197][160][193][206][212][197][160][201][211][160]5. [206][207][160][204][201][205][201][212][160][207][206][160][194][197][212][211]."
190 PRINT"[215][197][160][193][204][212][197][210][206][193][212][197][160][207][208][197][206][201][206][199]. [207][208][197][206][160][215][201][212][200][160][193][206][217][212][200][201][206][199]"
200 PRINT"[145][206][207][160][195][200][197][195][203][201][206][199]. [207][208][197][206][160][207][210][160][194][197][212][160]0[160]([198][207][204][196])."
210 PRINT"[215][200][197][206][160][193][211][203][197][196][160][212][207][160][198][207][204][196],[195][193][204][204],[207][210][160][210][193][201][211][197],"
220 PRINT"[210][197][208][204][217][160][215][201][212][200][160][198] [207][210][160][195] [207][210][160][210] [193][206][196] [210][197][212][213][210][206]."
230 PRINT"[215][200][197][206][160][193][211][203][197][196][160][212][207][160][194][197][212], [207][210][160][215][200][197][206][160][210][193][201][211][201][206][199],"
240 PRINT"[210][197][208][204][217][160][215][201][212][200][160][193][205][207][213][206][212][160][193][206][196][160][210][197][212][213][210][206]."
250 PRINT"[212][207][160][196][210][193][215], [197][206][212][197][210][160][197][193][195][200][160][195][193][210][196] [206][213][205][194][197][210][160][193][206][196][160][210][197][212]."
260 PRINT"[201][198][160][217][207][213][160][208][210][207][205][201][211][197][160][206][207][212][160][212][207][160][212][193][203][197][160][193][196][214][193][206][212][193][199][197][160][207][198]"
270 PRINT" [205][217][160][193][210][212][201][198][201][195][201][193][204] [201][206][212][197][204][204][197][199][197][206][195][197]"
280 PRINTTAB(6)"[212][200][193][212][160][196][207][197][211][206]'[212][160][203][206][207][215][160][215][200][197][206][160][212][207][160][198][207][204][196],"
290 PRINTTAB(9)"[201] [215][207][206]'[212][160][208][197][197][203][160][193][212][160][217][207][213][210][160][195][193][210][196][211] !"
300 GOSUB1550
310 INPUT"[207][203] [217][157][157][157]";Y$:PRINT"[147]":POKE53272,21
320 PRINT"[147] DEALER HAS"PB:PRINT" "UN$" HAS"UB:IFPB>0ANDUB>0GOTO370
330 Y$=UN$:IFPB<=0THENY$="DEALER"
340 PRINT" "Y$" IS BROKE"
350 INPUT" ANOTHER GAME Y[157][157][157]";YY$:Y$=LEFT$(YY$,1):IFY$="N"THENEND
360 PB=500:UB=500:IFY$<>"Y"THENPRINT"[145][145][145]":GOTO350
370 W=200:GOSUB1390:KN%=52
380 PRINT"[147]":IT=10:PB=PB-5:UB=UB-5:GOSUB900
390 FORM=0TO4:GOSUB1420:UH(M)=CN:LN=13:KL=M*8:GOSUB1440:GOSUB1420:PH(M)=CN
400 X%(M)=CN:LN=1:GOSUB1510:NEXT
410 PRINTLEFT$(Q4$,12)TAB(3)"1"TAB(11)"2"TAB(19)"3"TAB(27)"4"TAB(35)"5"
420 BR=1:GOSUB930:FORI=0TO4:PH(I)=X%(I):NEXT
430 PV=V:PY=TY:PD=VD:TU=1-TU:M=0:IFTUTHENM=INT(PY/3+1)*10:O=M
440 GOSUB710:ONXGOTO320,450
450 DR=0:W=150:GOSUB1390:GOSUB900
460 PRINTQ5$Q4$"CARD # "UN$", 0 IF NONE";:INPUTDN
470 IFDN=0GOTO510
480 IFDN<1ORDN>5GOTO460
490 DN=DN-1:IFUH(DN)<0GOTO460
500 DR=DR+1:UH(DN)=-1:LN=13:KL=DN*8:GOSUB1510:IFDR<3GOTO460
510 PRINTQ5$Q4$"DEALER TAKES"PD:GOSUB900
520 PRINT"":LN=13:FORI=0TO4
530 IFUH(I)<0THENGOSUB1420:UH(I)=CN:KL=I*8:GOSUB1440
540 NEXT
550 IFPD>0THENFORI=0TOPD-1:GOSUB1420:PH(I)=CN:NEXT
560 FORI=0TO4:X%(I)=PH(I):NEXT:BR=2:GOSUB930:PV=V:PY=TY
570 FORI=0TO4:X%(I)=UH(I):NEXT:GOSUB930:UV=V:UY=TY:M=0
580 IFTUTHENM=INT(PY/2+1)*10:IFPY<4ANDPY>1THENIFRF=0THENM=M+INT(12*RND(1)/4)*10
590 O=M:GOSUB710
600 LN=1:FORI=0TO4:KL=I*8:CN=PH(I):GOSUB1440:NEXT:I=PY:J=UY:IFX=1GOTO680
610 IFI=JTHENI=PV:J=UV
620 IFJ>ITHENW$=UN$:K=UY:GOTO640
630 W$="DEALER":K=PY
640 PRINTQ5$Q4$W$" WINS WITH "WW$(K)
650 IFI>JTHENPB=PB+IT:GOTO680
660 IFJ>ITHENUB=UB+IT:GOTO680
670 IT=IT/2:PB=PB+IT:UB=UB+IT
680 PRINTQ6$"HIT ANY KEY TO CONTINUE";
690 GETY$:IFY$=""GOTO690
700 GOTO320
710 GOSUB900:RF=0:IFMGOTO740
720 PRINTQ5$Q4$UN$" BETS";:INPUTR:O=R:TB=R:IFR>0GOTO800
730 X=1:PB=PB+IT:RETURN
740 PB=PB-M:IT=IT+M:PRINTQ7$Q6$"DEALER BETS"M;:GOSUB910:TB=M
750 R=0:PRINTQ5$Q4$"FOLD,CALL,RAISE "UN$;:INPUT" C[157][157][157]";YY$:Y$=LEFT$(YY$,1)
760 IFY$="F"THENPB=PB+IT:X=1:RETURN
770 IFY$="C"THENUB=UB-M:IT=IT+M:X=2:GOTO900
780 IFY$<>"R"GOTO750
790 PRINTQ4$TAB(17+LEN(UN$))" RAISE";:INPUTR:RF=1
800 UB=UB-R-M:IT=IT+R+M:X=2:TB=TB+R:MX=(PY+1)*O
810 PRINTQ7$Q6$"DEALER ";
820 IFPY>2GOTO870
830 IFBR=1ORPY>0GOTO860
840 IFPV>10*13^4GOTO860
850 UB=UB+IT:X=1:PRINT"FOLDS";:GOSUB1390:GOTO910
860 PB=PB-R:IT=IT+R:PRINT"CALLS";:GOTO910
870 IFMX<=TBGOTO860
880 M=INT(MX-TB):PB=PB-R-M:IT=IT+R+M
890 PRINT"RAISES"M;:GOSUB910:GOTO750
900 PRINTQ7$
910 PRINT"":PRINTQ6$TAB(31)" [157][157][157][157][157][157][157][157][157][157][157][157]POT="STR$(IT);:PRINT""
920 RETURN
930 FORI=0TO4:X2%(I)=INT(X%(I)/13):X%(I)=X%(I)-X2%(I)*13:NEXT
940 FORI=1TO4:T2=X%(I):T3=X2%(I)
950 FORJ=I-1TO0STEP-1:IFT2>X%(J)GOTO970
960 X%(J+1)=X%(J):X2%(J+1)=X2%(J):NEXTJ
970 X%(J+1)=T2:X2%(J+1)=T3:NEXTI
980 FK=0:FS=0:SK=0:SS=0:PK=0:PS=0:V=0:VD=0:TY=0
990 FORI=0TO4:T1=0:T2=0:T3=0:T4=0:T5=0:T6=0:T8=X%(I):T7=T8-I:E=1E5
1000 FORJ=0TO4:E=E/10
1010 IFX%(J)=T7+JTHENT1=T1+1:T2=T2+E
1020 IFX%(J)=T8THENT3=T3+1:T4=T4+E
1030 IFX2%(J)=I THENT5=T5+1:T6=T6+E
1040 NEXTJ
1050 IFT1>=SKTHENSK=T1:SS=T2
1060 IFT3>=PKTHENPK=T3:PS=T4
1070 IFT5>=FKTHENFK=T5:FS=T6
1080 NEXTI
1090 IFPK<3GOTO1130
1100 IFPK=4THENTY=8:GOTO1280
1110 TY=6:GOSUB1310:IFX%(0)<>X%(1)THENTY=3:VD=2
1120 GOTO1290
1130 IFSK=4AND(X%(3)=3ANDX%(4)=12)THENSK=5:V=90245
1140 IFFK=5THENTY=5
1150 IFSK=5THENTY=TY+4
1160 IFVGOTO1300
1170 IFTYGOTO1290
1180 J=0:IFBR=2GOTO1220
1190 J=X%(4)-X%(0):IFFK<4ANDSK<4GOTO1220
1200 TY=1.5:VD=1:PS=SS:IFFK=4THENPS=FS
1210 GOTO1280
1220 IFPK=2THENGOSUB1310:TY=1
1230 IFX%(1)=X%(2)THENPS=01111
1240 IFX%(1)=X%(0)THENPS=11011
1250 IFPS>11THENTY=2:VD=1:GOTO1280
1260 IFJ=3GOTO1200
1270 VD=3
1280 GOSUB1310
1290 GOSUB1380:V=T7
1300 FORI=0TO4:X%(I)=X%(I)+13*X2%(I):NEXT:RETURN
1310 E=1E5:FORI=0TO4:E=E/10:T2=INT((PS+1E-5)/E):PS%(I)=T2:PS=PS-T2*E:NEXT
1320 FORI=1TO4:IFPS%(I)GOTO137 0
1330 T2=PS%(I):T3=X%(I):T4=X2%(I)
1340 FORJ=I-1TO0STEP-1:IFPS%(J)=0GOTO136 0
1350 PS%(J+1)=PS%(J):X%(J+1)=X%(J):X2%(J+1)=X2%(J):NEXTJ
1360 PS%(J+1)=T2:X%(J+1)=T3:X2%(J+1)=T4
1370 NEXTI:RETURN
1380 T7=0:E=1:FORI=0TO4:T7=T7+X%(I)*E:E=E*13:NEXT:RETURN
1390 WT=TI
1400 IF TI<WT+WGOTO140 0
1410 RETURN
1420 K%=INT(KN%*RND(7)):CN=DK%(K%):FORLL=K%TO50:DK%(LL)=DK%(LL+1):NEXT
1430 DK%(51)=CN:KN%=KN%-1:RETURN
1440 REM UP
1450 J=INT(CN/13):K=CN-J*13:PRINTLEFT$(Q4$,LN);:PRINTTAB(KL);
1460 PRINT" "Q1$;:PRINT" "CV$(K,0)" "Q1$;
1470 PRINT" "SU$(J,3);SU$(J,S%(K,0))" "Q1$;
1480 FORL=1TO5:PRINT" "SU$(J,S%(K,L))" "Q1$;:NEXT
1490 PRINT" "SU$(J,S%(K,6));SU$(J,3)" "Q1$;:PRINT" "CV$(K,1)" "Q1$;
1500 PRINT" [146]"Q1$:RETURN
1510 PRINTLEFT$(Q4$,LN);:PRINTTAB(KL);
1520 PRINT" "Q1$;:REM FACE DOWN
1530 FORJ=2TO10:PRINT" [166][166][166][166][166] "Q1$;:NEXT
1540 GOTO1500
1550 Q1$="[157][157][157][157][157][157][157]":Q2$="[145][145][145][145][145][145][145][145][145][145][145]":Q4$=""
1560 XX$=" "
1570 Q5$=Q4$+XX$:Q6$=Q4$+"":Q7$=Q6$+XX$+"":Q8$="[157][157][157][157][157][157][157][157][157][157]"
1580 UB=500:PB=500:TU=1:I=RND(-TI)
1590 DIM DK%(52),SU$(3,13),CV$(12,1),S%(12,6),PH(4),UH(4),WW$(9)
1600 DIM X%(4),X2%(4),PS%(4)
1610 FORM=0TO52:DK%(M)=M:NEXT
1620 FORM=0TO3:SU$(M,0)=" ":FORK=1TO3:READSU$(M,K):NEXT:NEXT
1630 FORK=4TO13:READA$:FORM=0TO3:SU$(M,K)=A$:NEXT:NEXT
1640 FORM=0TO12:READCV$(M,0):READCV$(M,1):NEXT
1650 FORM=0TO12:FORK=0TO6:READS%(M,K):NEXT:NEXT
1660 FORM=0TO9:READ WW$(M):NEXT
1670 RETURN
1680 DATA" [211] ","[211] [211]","[211]"," [218] ","[218] [218]","[218]"," [216] ","[216] [216]","[216]"," [193] ","[193] [193]","[193]"
1690 DATA" J "," A "," C "," K "," Q "," U "," E "," N "," I "," G "
1700 DATA"2 "," 2","3 "," 3","4 "," 4","5 "," 5","6 "," 6","7 "," 7","8 "," 8"
1710 DATA"9 "," 9","10","10","J "," J","Q "," Q","K "," K","A "," A"
1720 DATA 0,1,0,0,0,1,0, 0,1,0,1,0,1,0, 0,2,0,0,0,2,0, 0,2,0,1,0,2,0
1730 DATA 0,2,0,2,0,2,0, 0,2,1,2,0,2,0, 0,2,1,2,1,2,0, 2,1,2,0,2,0,2
1740 DATA 2,1,2,0,2,1,2, 0,4,5,6,7,0,0, 0,8,9,10,10,11,0, 0,7,12,11,13,0,0
1750 DATA 0,0,0,1,0,0,0
1760 DATA "ZIP","A PAIR","TWO PAIR","THREE OF A KIND","A STRAIGHT","A FLUSH"
1770 DATA"A FULL HOUSE","7","FOUR OF A KIND","A STRAIGHT FLUSH"