Z80-21 Yet Another "BlackJack"
Z80-21 Yet Another "BlackJack"
I have a BlackJack game that does a few unique things like play cards by suit (which doesn't matter in BlackJack but it does to me), Helps you count cards left before the shuffle, follows rules you'd have at most actual Casio's with some caveats like...
The 5 card monte. That isn't a real rule but is there because of limited screen space.
Only one split per hand because of screen space again (although some casinos have that rule)
On split aces casinos generally only let you hit each once. I let you do more since if you want to follow the rule you can by staying if you want.
I am afraid to post it because XAVSNAP is going to absolutely hate that it is pushing the 16k limit.
The 5 card monte. That isn't a real rule but is there because of limited screen space.
Only one split per hand because of screen space again (although some casinos have that rule)
On split aces casinos generally only let you hit each once. I let you do more since if you want to follow the rule you can by staying if you want.
I am afraid to post it because XAVSNAP is going to absolutely hate that it is pushing the 16k limit.
Last edited by sanello on Mon Aug 01, 2022 5:24 am, edited 2 times in total.
-sanello
Re: Z80-21 Yet Another "BlackJack"
Oh, and a request. For just right now, I would like not to rewrite redundant or stupid code just yet. I would rather have it tested for outright errors in calculation or rules that we can all discuss. This is just so I can wrap my brain around it all first. I am guessing there are going to be some rule disagreements that will have to be hammered out.
There is one part of the code I would like to modify ahead of this, though. I would like to make sure only numbers can be accepted as bets. I think I figured out how to do that, but I don't want to modify anything yet.
There is one part of the code I would like to modify ahead of this, though. I would like to make sure only numbers can be accepted as bets. I think I figured out how to do that, but I don't want to modify anything yet.
-sanello
Re: Z80-21 Yet Another "BlackJack"
Just in case you downloaded my first upload, I reposted the newest code on the first post. I accidentally put old code at first. It has a different name so you know the difference.
-sanello
Re: Z80-21 Yet Another "BlackJack"
Hi sanello,
Original text file:
Some display optimisations to speed up the process.
And some space in memory to put the rules..
No more changes.
Original text file:
Code: Select all
1 GOSUB 9100
5 RAND
10 DIM P(5)
20 DIM D(5)
30 DIM A$(4,3)
40 LET A$(1)="CLB"
50 LET A$(2)="SPD"
60 LET A$(3)="DMD"
70 LET A$(4)="HRT"
80 LET W=1000
90 CLS
91 IF W<2 THEN GOTO 9900
92 IF W>9999 THEN GOTO 9970
100 PRINT AT 0,0;"SHUFFLING"
110 DIM C(13,4)
120 FOR I=1 TO 4
130 FOR N=1 TO 13
140 PRINT ".";
150 LET C(N,I)=N
160 NEXT N
170 NEXT I
180 LET L=52
190 CLS
192 IF W<1 THEN GOTO 9900
194 IF W>9999 THEN GOTO 9970
196 LET Y1=0
197 LET Y2=0
198 LET P1=0
199 LET P2=0
200 PRINT AT 10,0;"WALLET $";W;" "
202 FOR I=1 TO 5
204 LET P(I)=0
206 LET D(I)=0
208 NEXT I
210 PRINT AT 11,0;"BET ? "
220 INPUT B
221 IF B/2=INT (B/2) THEN GOTO 224
222 PRINT AT 11,0;"EVEN BETS ONLY"
223 GOTO 270
224 LET V=0
225 LET E=0
227 LET S=0
228 LET T=0
229 LET U=0
230 LET B=INT B
240 IF B<=W AND B<501 AND B>0 THEN GOTO 340
250 IF B>W THEN GOTO 300
260 PRINT AT 11,0;"max500min1"
270 FOR I=1 TO 100
280 NEXT I
290 GOTO 210
300 PRINT AT 11,0;"$LOW FUNDS$"
330 GOTO 270
340 PRINT AT 11,0;"BET $";B
350 LET W=W-B
360 PRINT AT 10,0;"WALLET $";W;" "
361 LET Q=0
362 LET B1=0
364 LET B2=0
370 LET A=0
380 LET J=0
390 GOSUB 7000
400 LET F=C(T,S)
410 LET E$=A$(S)
420 IF C(T,S)>9 THEN LET P(1)=10
430 IF C(T,S)>1 AND C(T,S)<=9 THEN LET P(1)=C(T,S)
440 IF C(T,S)=1 THEN LET P(1)=11
455 GOSUB 9096
460 GOSUB 2000
462 IF U>0 AND Y=1 THEN LET Y=11
464 IF U>0 AND Y=11 THEN LET P(1)=11
465 PRINT AT 7,0;Y;" "
470 LET J=6
480 GOSUB 7000
490 IF U=0 THEN LET M=C(T,S)
500 IF C(T,S)>9 THEN LET P(2)=10
510 IF C(T,S)>1 AND C(T,S)<=9 THEN LET P(2)=C(T,S)
520 IF C(T,S)=1 THEN LET P(2)=11
535 GOSUB 9096
540 IF Y>21 THEN LET P(1)=1
541 GOSUB 9096
542 GOSUB 2000
545 PRINT AT 7,0;Y;" "
547 IF U>0 THEN GOTO 715
550 LET A=15
560 LET J=0
570 GOSUB 7000
575 LET H=S
576 LET G=T
580 IF C(T,S)>9 THEN LET D(1)=10
590 IF C(T,S)>1 AND C(T,S)<=9 THEN LET D(1)=C(T,S)
591 IF C(T,S)=1 THEN LET D(1)=11
595 LET C(T,S)=0
610 GOSUB 5000
620 LET J=6
630 GOSUB 7000
640 IF C(T,S)>9 THEN LET D(2)=10
650 IF C(T,S)>1 AND C(T,S)<=9 THEN LET D(2)=C(T,S)
660 IF C(T,S)=1 THEN LET D(2)=11
665 GOSUB 9092
670 IF Z>21 AND D(1)=11 THEN LET D(1)=1
685 GOSUB 9092
690 GOSUB 2000
692 PRINT AT 14,0;D(2);" "
697 IF U=1 THEN GOTO 715
700 IF F=M THEN GOSUB 8000
705 IF U=0 THEN GOSUB 9000
710 IF U=1 THEN GOTO 460
715 IF U=0 THEN LET BC=B
716 IF U=1 THEN LET BC=B1
717 IF U=2 THEN LET BC=B2
718 IF W>=B+BC THEN PRINT AT 7,6;"HIT,STAY OR DOUBLE? H/S/D"
719 IF W<B+BC THEN PRINT AT 7,6;"HIT OR STAY? H/S"
720 INPUT H$
730 PRINT AT 7,6;" "
740 IF H$="S" THEN GOTO 3000
750 IF H$="H" THEN GOTO 770
755 IF H$="D" THEN GOTO 765
760 GOTO 718
765 IF W>=B+BC THEN GOTO 770
767 GOTO 715
770 LET A=0
771 LET J=12
775 IF H$="D" THEN LET W=W-BC
778 IF H$="D" THEN LET B=B+BC
781 IF H$="D" AND U=2 THEN LET B2=B2+B2
782 IF H$="D" AND U=1 THEN LET B1=B1+B1
787 PRINT AT 11,0;"BET $";B
788 PRINT AT 10,0;"WALLET $";W;" "
789 IF U<>0 THEN PRINT AT 9,0;"BET1 $";B1;" BET2 $";B2
790 GOSUB 7000
800 IF C(T,S)>9 THEN LET P(3)=10
810 IF C(T,S)>1 AND C(T,S)<=9 THEN LET P(3)=C(T,S)
820 IF C(T,S)=1 THEN LET P(3)=11
825 GOSUB 9096
830 IF Y>21 AND P(1)=11 THEN LET P(1)=1
835 GOSUB 9096
840 IF Y>21 AND P(2)=11 THEN LET P(2)=1
845 GOSUB 9096
850 IF Y>21 AND P(3)=11 THEN LET P(3)=1
855 GOSUB 9096
860 GOSUB 2000
870 IF Y>21 THEN GOTO 3000
880 PRINT AT 7,0;Y;" "
885 IF H$="D" THEN GOTO 3000
890 PRINT AT 7,6;"HIT OR STAY? H/S"
900 INPUT H$
910 PRINT AT 7,6;" "
920 IF H$="S" THEN GOTO 3000
930 IF H$="H" THEN GOTO 950
940 GOTO 890
950 LET J=18
960 GOSUB 7000
970 IF C(T,S)>9 THEN LET P(4)=10
980 IF C(T,S)>1 AND C(T,S)<=9 THEN LET P(4)=C(T,S)
990 IF C(T,S)=1 THEN LET P(4)=11
995 GOSUB 9096
1000 IF Y>21 AND P(1)=11 THEN LET P(1)=1
1005 GOSUB 9096
1010 IF Y>21 AND P(2)=11 THEN LET P(2)=1
1015 GOSUB 9096
1020 IF Y>21 AND P(3)=11 THEN LET P(3)=1
1025 GOSUB 9096
1030 IF Y>21 AND P(4)=11 THEN LET P(4)=1
1035 GOSUB 9096
1040 GOSUB 2000
1050 IF Y>21 THEN GOTO 3000
1060 PRINT AT 7,0;Y;" "
1070 PRINT AT 7,6;"HIT OR STAY? H/S"
1080 INPUT H$
1090 PRINT AT 7,6;" "
1100 IF H$="S" THEN GOTO 3000
1110 IF H$="H" THEN GOTO 1130
1120 GOTO 1070
1130 LET J=24
1140 GOSUB 7000
1150 IF C(T,S)>9 THEN LET P(5)=10
1160 IF C(T,S)<=9 THEN LET P(5)=C(T,S)
1170 FOR I=1 TO 4
1180 IF P(I)=11 THEN LET P(I)=1
1190 NEXT I
1195 GOSUB 9096
1200 GOSUB 2000
1201 IF Y>21 AND P(5)=11 THEN LET P(5)=1
1202 GOSUB 9096
1205 IF U=1 THEN LET P1=P(5)
1207 IF U=2 THEN LET P2=P(5)
1210 IF Y>21 THEN GOTO 3000
1220 PRINT AT 7,0;Y;" "
1230 GOTO 3000
2000 IF C(T,S)=1 THEN GOSUB 5100
2010 IF C(T,S)=2 THEN GOSUB 5200
2020 IF C(T,S)=3 THEN GOSUB 5300
2030 IF C(T,S)=4 THEN GOSUB 5400
2040 IF C(T,S)=5 THEN GOSUB 5500
2050 IF C(T,S)=6 THEN GOSUB 5600
2060 IF C(T,S)=7 THEN GOSUB 5700
2070 IF C(T,S)=8 THEN GOSUB 5800
2080 IF C(T,S)=9 THEN GOSUB 5900
2090 IF C(T,S)=10 THEN GOSUB 6000
2100 IF C(T,S)=11 THEN GOSUB 6100
2110 IF C(T,S)=12 THEN GOSUB 6200
2120 IF C(T,S)=13 THEN GOSUB 6300
2130 LET C(T,S)=0
2140 RETURN
3000 GOSUB 9096
3001 IF Y>21 THEN PRINT AT 7,0;"BUST"
3002 IF U=1 THEN GOSUB 8160
3003 IF U=2 THEN GOSUB 8260
3005 GOSUB 9800
3014 IF Z>16 THEN GOTO 4510
3015 LET J=12
3016 IF Y>21 THEN GOTO 4515
3017 IF Y1>21 AND Y2>21 THEN GOTO 4800
3020 GOSUB 7000
3030 IF C(T,S)>9 THEN LET D(3)=10
3040 IF C(T,S)<=9 THEN LET D(3)=C(T,S)
3050 IF C(T,S)=1 THEN LET D(3)=11
3055 GOSUB 9092
3060 IF Z>21 AND D(1)=11 THEN LET D(1)=1
3065 GOSUB 9092
3070 IF Z>21 AND D(2)=11 THEN LET D(2)=1
3075 GOSUB 9092
3080 IF Z>21 AND D(3)=11 THEN LET D(3)=1
3085 GOSUB 9092
3090 GOSUB 2000
3095 PRINT AT 14,0;Z;" "
3100 IF Z>21 THEN GOTO 4500
3110 IF Z>16 THEN GOTO 4510
3120 LET J=18
3130 GOSUB 7000
3140 IF C(T,S)>9 THEN LET D(4)=10
3150 IF C(T,S)<=9 THEN LET D(4)=C(T,S)
3160 IF C(T,S)=1 THEN LET D(4)=11
3165 GOSUB 9092
3170 IF Z>21 AND D(1)=11 THEN LET D(1)=1
3175 GOSUB 9092
3180 IF Z>21 AND D(2)=11 THEN LET D(2)=1
3185 GOSUB 9092
3190 IF Z>21 AND D(3)=11 THEN LET D(3)=1
3195 GOSUB 9092
3200 IF Z>21 AND D(4)=11 THEN LET D(4)=1
3205 GOSUB 9092
3210 GOSUB 2000
3220 PRINT AT 14,0;Z;" "
3230 IF Z>21 THEN GOTO 4500
3240 IF Z>16 THEN GOTO 4510
3250 LET J=24
3260 GOSUB 7000
3270 IF C(T,S)>9 THEN LET D(5)=10
3280 IF C(T,S)<=9 THEN LET D(5)=C(T,S)
3290 IF C(T,S)=1 THEN LET D(5)=11
3295 GOSUB 9092
3300 IF Z>21 AND D(1)=11 THEN LET D(1)=1
3305 GOSUB 9092
3310 IF Z>21 AND D(2)=11 THEN LET D(2)=1
3315 GOSUB 9092
3320 IF Z>21 AND D(3)=11 THEN LET D(3)=1
3325 GOSUB 9092
3330 IF Z>21 AND D(4)=11 THEN LET D(4)=1
3335 GOSUB 9092
3340 IF Z>21 AND D(5)=11 THEN LET D(5)=1
3345 GOSUB 9092
3350 GOSUB 2000
3360 PRINT AT 14,0;Z;" "
3370 IF Z>21 THEN GOTO 4500
3380 GOTO 4510
4500 PRINT AT 14,0;"BUST"
4510 GOSUB 9092
4515 LET K=0
4516 IF Y1>0 THEN GOTO 4800
4530 IF Y>Z AND Y<22 THEN LET K=1
4540 IF Z>21 AND Y<22 THEN LET K=1
4550 IF Z=Y AND Y<22 THEN LET K=3
4554 IF Z<22 AND Y<22 AND P(5)>0 THEN LET K=1
4556 IF Y=21 AND Z<>21 THEN LET K=2
4560 IF K=1 THEN LET W=W+B+B
4565 IF K=2 THEN LET W=INT (W+B+(B*(O/X)))
4570 IF K=3 THEN LET W=W+B
4580 IF K=1 OR K=2 THEN PRINT AT 3,0;"««winner«winner«winner«winner«««"
4590 IF K=3 THEN PRINT AT 3,0;"«draw«push«draw«push«draw«push««"
4600 IF K=0 THEN PRINT AT 3,0;"««loser«loser«loser«loser«loser«"
4610 FOR I=1 TO 50
4620 NEXT I
4630 GOTO 6505
4800 LET K1=0
4801 LET K2=0
4804 IF Y1>Z AND Y1<22 THEN LET K1=1
4805 IF Y2>Z AND Y2<22 THEN LET K2=1
4810 IF Z>21 AND Y1<22 THEN LET K1=1
4815 IF Z>21 AND Y2<22 THEN LET K2=1
4820 IF Z=Y1 AND Y1<22 THEN LET K1=3
4825 IF Z=Y2 AND Y2<22 THEN LET K2=3
4830 IF Z<22 AND Y1<22 AND P1>0 THEN LET K1=1
4835 IF Z<22 AND Y2<22 AND P2>0 THEN LET K2=1
4837 IF Y1=21 AND Z<>21 THEN LET K1=2
4838 IF Y2=21 AND Z<>21 THEN LET K2=2
4840 IF K1=1 THEN LET W=W+B1+B1
4845 IF K2=1 THEN LET W=W+B2+B2
4847 IF K1=2 THEN LET W=INT (W+(B1*(O/X)))
4848 IF K2=2 THEN LET W=INT (W+(B2*(O/X)))
4850 IF K1=3 THEN LET W=W+B1
4855 IF K2=3 THEN LET W=W+B2
4860 IF K1=1 OR K1=2 THEN PRINT AT 3,0;"«««hand˜«winner«winner«winner«««"
4865 IF K2=1 OR K2=2 THEN PRINT AT 5,0;"«««hand™«winner«winner«winner«««"
4870 IF K1=3 THEN PRINT AT 3,0;"«hand˜«push«draw«push«draw«push«"
4875 IF K2=3 THEN PRINT AT 3,0;"«hand™«push«draw«push«draw«push«"
4880 IF K1=0 THEN PRINT AT 3,0;"«hand˜«loser«loser«loser«loser««"
4885 IF K2=0 THEN PRINT AT 5,0;"«hand™«loser«loser«loser«loser««"
4890 FOR I=1 TO 50
4900 NEXT I
4999 GOTO 6505
5000 PRINT AT A,J;"«¯¯¯¯"
5005 FOR I=1 TO 5
5010 PRINT AT A+I,J;"ª±±±¯"
5020 NEXT I
5030 PRINT AT A+6,J;"ªªªª«"
5040 RETURN
5100 PRINT AT A,J;"¼¸¸¸¯"
5110 PRINT AT A+1,J;"º²¸¹°"
5120 PRINT AT A+2,J;"ºº °°"
5130 PRINT AT A+3,J;"º¼¸¯°"
5140 PRINT AT A+4,J;"ºº °°"
5150 PRINT AT A+5,J;"º";A$(S);"°"
5160 PRINT AT A+6,J;"ª®®®¬"
5170 RETURN
5200 PRINT AT A,J;"¼¸¸¸¯"
5210 PRINT AT A+1,J;"º 2 °"
5220 PRINT AT A+2,J;"º °"
5230 PRINT AT A+3,J;"º 2 °"
5240 PRINT AT A+4,J;"º °"
5250 PRINT AT A+5,J;"º";A$(S);"°"
5260 PRINT AT A+6,J;"ª®®®¬"
5270 RETURN
5300 PRINT AT A,J;"¼¸¸¸¯"
5310 PRINT AT A+1,J;"º 3 °"
5320 PRINT AT A+2,J;"º 3 °"
5330 PRINT AT A+3,J;"º 3 °"
5340 PRINT AT A+4,J;"º °"
5350 PRINT AT A+5,J;"º";A$(S);"°"
5360 PRINT AT A+6,J;"ª®®®¬"
5370 RETURN
5400 PRINT AT A,J;"¼¸¸¸¯"
5410 PRINT AT A+1,J;"º4 4°"
5420 PRINT AT A+2,J;"º °"
5430 PRINT AT A+3,J;"º4 4°"
5440 PRINT AT A+4,J;"º °"
5450 PRINT AT A+5,J;"º";A$(S);"°"
5460 PRINT AT A+6,J;"ª®®®¬"
5470 RETURN
5500 PRINT AT A,J;"¼¸¸¸¯"
5510 PRINT AT A+1,J;"º5 5°"
5520 PRINT AT A+2,J;"º 5 °"
5530 PRINT AT A+3,J;"º5 5°"
5540 PRINT AT A+4,J;"º °"
5550 PRINT AT A+5,J;"º";A$(S);"°"
5560 PRINT AT A+6,J;"ª®®®¬"
5570 RETURN
5600 PRINT AT A,J;"¼¸¸¸¯"
5610 PRINT AT A+1,J;"º6 6°"
5620 PRINT AT A+2,J;"º6 6°"
5630 PRINT AT A+3,J;"º6 6°"
5640 PRINT AT A+4,J;"º °"
5650 PRINT AT A+5,J;"º";A$(S);"°"
5660 PRINT AT A+6,J;"ª®®®¬"
5670 RETURN
5700 PRINT AT A,J;"¼¸¸¸¯"
5710 PRINT AT A+1,J;"º7 7°"
5720 PRINT AT A+2,J;"º 7 °"
5730 PRINT AT A+3,J;"º7 7°"
5740 PRINT AT A+4,J;"º7 7°"
5750 PRINT AT A+5,J;"º";A$(S);"°"
5760 PRINT AT A+6,J;"ª®®®¬"
5770 RETURN
5800 PRINT AT A,J;"¼¸¸¸¯"
5810 PRINT AT A+1,J;"º8 8°"
5820 PRINT AT A+2,J;"º8 8°"
5830 PRINT AT A+3,J;"º8 8°"
5840 PRINT AT A+4,J;"º8 8°"
5850 PRINT AT A+5,J;"º";A$(S);"°"
5860 PRINT AT A+6,J;"ª®®®¬"
5870 RETURN
5900 PRINT AT A,J;"¼¸¸¸¯"
5910 PRINT AT A+1,J;"º9 9°"
5920 PRINT AT A+2,J;"º9 9°"
5930 PRINT AT A+3,J;"º999°"
5940 PRINT AT A+4,J;"º9 9°"
5950 PRINT AT A+5,J;"º";A$(S);"°"
5960 PRINT AT A+6,J;"ª®®®¬"
5970 RETURN
6000 PRINT AT A,J;"¼¸¸¸¯"
6010 PRINT AT A+1,J;"ºTEN°"
6020 PRINT AT A+2,J;"º ˜ °"
6030 PRINT AT A+3,J;"º — °"
6040 PRINT AT A+4,J;"ºTEN°"
6050 PRINT AT A+5,J;"º";A$(S);"°"
6060 PRINT AT A+6,J;"ª®®®¬"
6070 RETURN
6100 PRINT AT A,J;"¼¸¸¸¯"
6110 PRINT AT A+1,J;"º·¯¸°"
6120 PRINT AT A+2,J;"º ° °"
6130 PRINT AT A+3,J;"º ° °"
6140 PRINT AT A+4,J;"º±» °"
6150 PRINT AT A+5,J;"º";A$(S);"°"
6160 PRINT AT A+6,J;"ª®®®¬"
6170 RETURN
6200 PRINT AT A,J;"¼¸¸¸¯"
6210 PRINT AT A+1,J;"º²¸¹°"
6220 PRINT AT A+2,J;"ºº °°"
6230 PRINT AT A+3,J;"ºº²°°"
6240 PRINT AT A+4,J;"º·®±°"
6250 PRINT AT A+5,J;"º";A$(S);"°"
6260 PRINT AT A+6,J;"ª®®®¬"
6270 RETURN
6300 PRINT AT A,J;"¼¸¸¸¯"
6310 PRINT AT A+1,J;"ºº »°"
6320 PRINT AT A+2,J;"ºª» °"
6330 PRINT AT A+3,J;"º¼± °"
6340 PRINT AT A+4,J;"ºº ±°"
6350 PRINT AT A+5,J;"º";A$(S);"°"
6360 PRINT AT A+6,J;"ª®®®¬"
6370 RETURN
6500 PRINT "BUST"
6505 IF L>16 THEN GOTO 190
6510 GOTO 90
7000 LET T=INT (RND*13+1)
7100 LET S=INT (RND*4+1)
7500 IF C(T,S)=0 THEN GOTO 7000
7540 LET L=L-1
7550 PRINT AT 14,18;"CARDS LEFT:";L;" "
7600 RETURN
8000 IF W<B+B AND U=0 THEN RETURN
8005 IF U=2 THEN RETURN
8006 GOSUB 9000
8010 PRINT AT 7,8;"splitŠ Y OR N"
8012 INPUT Q$
8015 IF Q$="Y" THEN GOTO 8050
8020 IF Q$="N" THEN GOTO 8040
8030 GOTO 8010
8040 RETURN
8050 LET U=1
8056 LET A=0
8057 PRINT AT 7,8;" "
8060 PRINT AT 5,0;"hand˜"
8061 FOR I=0 TO 6
8062 PRINT AT I,6;" "
8063 NEXT I
8085 LET B1=B
8090 LET B2=B
8100 PRINT AT 9,0;"BET1 $";B1;" BET2 $";B2
8110 LET W=W-B1
8120 LET B=B+B
8130 PRINT AT 11,0;"BET $";B
8140 PRINT AT 10,0;"WALLET $";W;" "
8150 RETURN
8160 LET Y1=Y
8162 FOR I=1 TO 20
8164 NEXT I
8166 PRINT AT 7,0;" "
8170 LET U=2
8180 FOR I=2 TO 5
8190 LET P(I)=0
8200 NEXT I
8210 LET C(T,S)=M
8215 PRINT AT 5,0;"hand™"
8220 LET A=0
8230 LET J=0
8231 FOR I=0 TO 6
8232 PRINT AT I,6;" "
8233 NEXT I
8240 PRINT AT 12,0;"hand˜ SUM ";Y1
8250 GOTO 470
8260 LET Y2=Y
8262 FOR I=1 TO 20
8264 NEXT I
8270 PRINT AT 12,15;"hand™ SUM: ";Y2
8900 RETURN
9000 IF Y=21 AND Z=21 THEN GOSUB 9800
9001 IF Y<>21 AND D(2)=11 AND W>=B/2 THEN GOTO 9019
9002 IF Y=21 AND Z<>21 THEN LET K=2
9003 IF Z=21 AND Y<>21 THEN LET K=0
9004 IF Z<>21 AND Y<>21 THEN RETURN
9005 GOSUB 9800
9006 GOTO 4560
9019 PRINT AT 7,8;"insuranceŠ Y/N"
9020 INPUT Q$
9025 PRINT AT 7,8;" "
9030 IF Q$="Y" THEN GOTO 9070
9040 IF Q$="N" THEN GOTO 9081
9060 GOTO 9010
9070 IF Z=21 THEN LET W=W+(B/2)
9075 IF Z<>21 THEN LET W=W-(B/2)
9076 PRINT AT 10,0;"WALLET $";W;" "
9078 IF Z=21 THEN PRINT AT 8,0;"ins–«won"
9080 IF Z<>21 THEN PRINT AT 8,0;"ins–«lost"
9081 IF Z=21 THEN GOSUB 9800
9082 IF Z=21 THEN GOTO 4515
9090 GOTO 9002
9092 LET Z=D(1)+D(2)+D(3)+D(4)+D(5)
9094 RETURN
9096 LET Y=P(1)+P(2)+P(3)+P(4)+P(5)
9098 RETURN
9100 PRINT AT 0,0;" ¬ª¿¸¸¸¸¼¿¼¸¯¿¼¸¯¿¿¿¿»¸¯¿¿¬¿»±¸¹"
9110 PRINT AT 1,0;"®««µ¿¿¿»¿¿º¿°¿º¿°¿¿¿¿¿¿»¿·°° °"
9120 PRINT AT 2,0;"««««¿¿»¿¿¿«««¿º¿°¿²µ¿¿»¿¿¿°¿± ²¶"
9130 PRINT AT 3,0;"·¯¼¶¿»¿¿¿¿º¿°¿º¿°¿¿¿¿»¿¿¿¿°¿¿±¶"
9140 PRINT AT 4,0;" ·¶¿¬µµµµ¿ªµ¬¿ªµ¬¿¿¿¿ªµµ¿¿¬µ¿¿"
9145 PRINT AT 5,0;"¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿"
9150 PRINT AT 17,0;" ¹"
9160 PRINT AT 18,0;" »·¹"
9170 PRINT AT 19,0;"» ·¹"
9180 PRINT AT 20,0;"·¹ »"
9190 PRINT AT 21,0;" ·» PROGRAMMED BY: S.ANELLO"
9240 PRINT AT 18,28;" ²ª"
9250 PRINT AT 19,28;"²««ª"
9260 PRINT AT 20,28;"·««¼"
9270 PRINT AT 21,28;" º"
9280 PRINT AT 10,2;"ENTER TABLE RULES ²1 FOR 2:1"
9290 PRINT AT 11,4;"FOR 21 PAYOUT ²2 FOR 3:2"
9300 PRINT AT 12,20;"²3 FOR 6:5"
9400 INPUT Q$
9410 IF Q$="1" THEN GOTO 9430
9411 IF Q$="2" THEN GOTO 9440
9412 IF Q$="3" THEN GOTO 9450
9420 GOTO 9400
9430 LET O=2
9432 LET X=1
9434 RETURN
9440 LET O=3
9442 LET X=2
9444 RETURN
9450 LET O=6
9452 LET X=5
9454 RETURN
9800 LET A=15
9810 LET J=0
9820 LET C(G,H)=G
9830 LET S=H
9840 LET T=G
9850 GOSUB 2000
9860 PRINT AT 14,0;Z;" "
9870 RETURN
9900 CLS
9910 PRINT "WALLET EMPTY"
9920 PRINT "PLAY AGAIN? Y/N"
9930 INPUT P$
9940 IF P$="Y" THEN GOTO 1
9950 IF P$="N" THEN GOTO 9999
9960 GOTO 9930
9970 CLS
9980 PRINT "YOU BEAT THE HOUSE WINNING $";W
9990 GOTO 9920
9999 PRINT "THANKS FOR PLAYING"
And some space in memory to put the rules..
No more changes.
Last edited by XavSnap on Fri Aug 05, 2022 3:48 am, edited 3 times in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: Z80-21 Yet Another "BlackJack"
@XAVSNAP
Looked it over. All changes I know should be made thanks to you. I'd still like to know if you are editing in something other then an emulator. I imagine a version of notepad that uses ZX81 ASCII instead of native somehow. Copy and paste would be so nice.
Looked it over. All changes I know should be made thanks to you. I'd still like to know if you are editing in something other then an emulator. I imagine a version of notepad that uses ZX81 ASCII instead of native somehow. Copy and paste would be so nice.
-sanello
Re: Z80-21 Yet Another "BlackJack"
This should be helpful Not sure if it is complete.
VARIABLE FUNCTION
P Players Cards
D Dealers Cards
A$ Suits
W Wallet
L Cards Left
C Actual Cards
B E Bet
A Screen Row
J Screen Column
E$ Current Suit
H$ HIT?
Q$ Question
U Split?
T Double
F First Card
M Second Split Card
V Victorious 0 1 2 3
H Dealer first suit
G Dealers first card
Y Player Total
Z Computer Total
K WIN/LOSE
R 11 11
O O\X ODDS
X O\X ODDS
Q Insurance
H Dealer Total
VARIABLE FUNCTION
P Players Cards
D Dealers Cards
A$ Suits
W Wallet
L Cards Left
C Actual Cards
B E Bet
A Screen Row
J Screen Column
E$ Current Suit
H$ HIT?
Q$ Question
U Split?
T Double
F First Card
M Second Split Card
V Victorious 0 1 2 3
H Dealer first suit
G Dealers first card
Y Player Total
Z Computer Total
K WIN/LOSE
R 11 11
O O\X ODDS
X O\X ODDS
Q Insurance
H Dealer Total
-sanello
Re: Z80-21 Yet Another "BlackJack"
@XavSnap
Getting wrong outcome on splitting Ace's. Not sure yet if it preexisted your modifications. It probably did, but I'll make sure. After I sleep then get home from work, though.
Getting wrong outcome on splitting Ace's. Not sure yet if it preexisted your modifications. It probably did, but I'll make sure. After I sleep then get home from work, though.
-sanello
Re: Z80-21 Yet Another "BlackJack"
Listing on a "NotePad"
viewtopic.php?p=42265#p42265
The Windows font to read my BASIC listings and i reload it on VB81: I just add those variable: B$,C$,D$,F$,G$,I$ I changed only the card display, not the calculation.
viewtopic.php?p=42265#p42265
The Windows font to read my BASIC listings and i reload it on VB81: I just add those variable: B$,C$,D$,F$,G$,I$ I changed only the card display, not the calculation.
Code: Select all
Variables Resident in Memory :
Q$= "3"
O = 6
X = 5
DIM P(5)
P(1) = 5
P(2) = 8
DIM D(5)
D(1) = 6
D(2) = 4
D(3) = 11
DIM A$(4,3)
A$(1) = "CLB"
A$(2) = "SPD"
A$(3) = "DMD"
A$(4) = "HRT"
B$= "_____"
C$= "_____"
D$= "WINNER "
F$= "LOSER "
G$= "DRAW "
I$= "PUSH "
W = 0
DIM C(13,4)
C(1,1) = 1
C(1,2) = 1
C(1,4) = 1
C(2,1) = 2
C(2,2) = 2
C(2,3) = 2
C(3,1) = 3
C(3,2) = 3
C(3,3) = 3
C(3,4) = 3
C(4,1) = 4
C(4,2) = 4
C(5,1) = 5
C(5,2) = 5
C(5,4) = 5
C(6,3) = 6
C(6,4) = 6
C(7,1) = 7
C(7,3) = 7
C(7,4) = 7
C(8,1) = 8
C(8,2) = 8
C(9,1) = 9
C(9,2) = 9
C(9,3) = 9
C(9,4) = 9
C(10,2) = 10
C(10,3) = 10
C(10,4) = 10
C(11,1) = 11
C(11,2) = 11
C(11,3) = 11
C(11,4) = 11
C(12,1) = 12
C(12,2) = 12
C(12,3) = 12
C(12,4) = 12
C(13,1) = 13
C(13,2) = 13
C(13,3) = 13
C(13,4) = 13
I : For-Next
I = 51
N : For-Next
N = 14
L = 41
Y1 = 0
Y2 = 0
P1 = 0
P2 = 0
B = 500
V = 0
E = 0
S = 3
T = 1
U = 0
Q = 0
B1 = 0
B2 = 0
A = 15
J = 12
F = 5
Y = 13
M = 8
H = 2
G = 6
Z = 21
BC = 500
K = 0
E$= "DMD"
H$= "S"
Xavier ...on the Facebook groupe : "Zx81 France"(fr)