Thursday, October 24, 2024

TI-99/4A slots in TI BASIC

Below is the slots code I wrote this summer for the TI-99/4A  I never finished the code for the Atari 800


1 REM Slots by Michael Gibson GPL 2024
3 call color(1,7,16)
5 call color(2,7,16)
10 call color(3,7,16)
15 call color(4,7,16)
20 call color(5,7,16)
25 call color(6,7,16)
30 call color(7,7,16)
35 call color(8,7,16)
40 call color(9,7,16)
45 call color(10,13,16)
50 call color(11,2,16)
55 call color(12,6,16)
60 call color(13,11,16)
65 call color(14,5,16)
70 call color(15,2,16)

71 REM number7
75 call char(92,"007F7F7070")
80 call char(93,"00FFFF0E0E1C3838")
85 call char(94,"00000001010307")
90 call char(95,"7070E0C0C0C0C0")

91 REM heart
95 call char(96,"00001C3E7F7F7F7F")
100 call char(97,"0000387CFEFEFEFE")
110 call char(98,"3F1F0F070301")
120 call char(99,"FCF8F0E0C080")

129 REM Cherry
130 call char(100,"00000000001F3F7F")
140 call char(104,"0000060810204080")
150 call char(101,"7F7F7F7F3F3F1F")
160 call char(102,"E0F0F0F0F0E0C0")

169 REM Bell
170 call char(112,"0000010101010101")
180 call char(113,"0000808080808080")
190 call char(120,"03070707070F0701")
200 call char(121,"C0E0E0E0E0F0E080")

209 REM Lemon
210 call char(128,"000000030F1F3FFF")
220 call char(129,"000000C0F0F8FCFF")
230 call char(130,"FF3F1F0F03")
240 call char(131,"FFFCF8F0C0")

249 REM Diamond
250 call char(105,"000103070F1F3F7F")
255 call char(106,"0080C0E0F0F8FCFE")
260 call char(107,"7F3F1F0F070301")
265 call char(108,"FEFCF8F0E0C080")

266 REM RED/GREEN 7
267 call char(134,"00000001010307")
268 call char(135,"7070E0C0C0C0C0")

269 REM BAR
270 call char(136,"00000000003F3F3F")
280 call char(137,"0000000000FCFCFC")
290 call char(138,"3F3F3F")
300 call char(139,"FCFCFC")

309 REM D-BAR
310 call char(140,"00003F3F3F3F")
320 call char(141,"0000FCFCFCFC")
330 call char(142,"003F3F3F3F3F")
340 call char(143,"00FEFEFEFEFE")

349 REM T-BAR
350 call char(144,"003F3F3F3F003F3F")
355 call char(145,"00FCFCFCFC00FCFC")
360 call char(146,"3F3F003F3F3F3F00")
365 call char(147,"FCFC00FCFCFCFC00")

369 REM SPADE
370 call char(148,"000103070F1F3F3F")
380 call char(149,"0080C0E0F0F8FCFC")
385 call char(150,"7F7F3F1B03070F")
390 call char(151,"FEFEFCD8C0E0F0")

391 REM black Diamond
392 call char(115,"000103070F1F3F7F")
393 call char(116,"0080C0E050A8FCFE")
394 call char(117,"7F3F1F0F070301")
395 call char(118,"FEFCF8F0E0C080")

396 REM slot window
397 call char(91, "FF00FFFF55AA55AA")
398 call char(103,"AA55AA55FF00FFFF")
399 call char(114,"1010101010101010")

410 RANDOMIZE
420 CALL CLEAR
425 call hchar(11,11,91,10)
426 call hchar(14,11,103,10)
427 call hchar(12,11,114,10)
428 call hchar(13,11,114,10)
430 C=12
440 FOR I=1 TO 3
450 PIC(I)=INT(17*RND)+1
460 ON PIC(I) GOSUB 840,900,960,1020,1080,1140,1200,1260,1320,1380,1450,1510,1570,1630,1690,1750,1810
470 C=C+3
480 NEXT I

490 REM Scoring
493 if PIC(1)=11 then 610
494 if PIC(1)=12 then 610
495 if PIC(1)=13 then 610
496 if PIC(1)=14 then 610
497 if PIC(1)=4 then 660
500 if PIC(1)<>PIC(2) then 520
510 if PIC(2)=PIC(3) then 700
520 if PIC(1)<>PIC(3) then 610
530 GOTO 650

610 REM Check middle
611 TOTAL=TOTAL-10
612 if PIC(2)=1 then 635
613 if PIC(2)=4 then 635
614 if PIC(2)=15 then 635

620 print "SORRY! YOU LOSE!"
625 GOTO 770

635 Print "MIDDLE WIN $20!"
637 TOTAL=TOTAL+30
640 goto 770

650 TOTAL=TOTAL+50
655 print "OUTER MATCH - YOU WON $50"
657 GOTO 770

660 TOTAL=TOTAL+20
665 print "1ST LEMON - YOU WON $20!"
670 GOTO 770

700 REM Jack POT
710 if PIC(1)=1 Then 730
720 Goto 750

730 TOTAL=TOTAL+500
740 Print "3 HEARTS JACKPOT! YOU WON $500"
745 GOTO 770

750 TOTAL=TOTAL+250
760 Print "3 OF A KIND JACKPOT! YOU WON $250"
770 print "CURRENT TOTAL: $";TOTAL
780 print "WANT TO PLAY AGAIN?"
790 PRINT "PRESS Y FOR YES"
800 CALL KEY(0,KEY,STATUS)
810 if STATUS=0 then 800
820 if KEY=89 then 410

830 End

840 REM 1 sel - draw heart
850 call hchar(12,C,96)
860 call hchar(12,C+1,97)
870 call hchar(13,C,98)
880 call hchar(13,C+1,99)
890 return

900 REM 2 sel - draw cherry
910 call hchar(12,C,100)
920 call hchar(12,C+1,104)
930 call hchar(13,C,101)
940 call hchar(13,C+1,102)
950 return

960 REM 3 sel - draw bell
970 call hchar(12,C,112)
980 call hchar(12,C+1,113)
990 call hchar(13,C,120)
1000 call hchar(13,C+1,121)
1010 return

1020 REM 4 sel - draw Lemon
1030 call hchar(12,C,128)
1040 call hchar(12,C+1,129)
1050 call hchar(13,C,130)
1060 call hchar(13,C+1,131)
1070 return

1080 REM 5 sel - draw Diamond
1090 call hchar(12,C,105)
1100 call hchar(12,C+1,106)
1110 call hchar(13,C,107)
1120 call hchar(13,C+1,108)
1130 return

1140 REM 6 sel - draw Bar
1150 call hchar(12,C,136)
1160 call hchar(12,C+1,137)
1170 call hchar(13,C,138)
1180 call hchar(13,C+1,139)
1190 return

1200 REM 7 sel - draw number7
1210 call hchar(12,C,92)
1220 call hchar(12,C+1,93)
1230 call hchar(13,C,94)
1240 call hchar(13,C+1,95)
1250 return

1260 REM 8 sel - draw double bar
1270 call hchar(12,C,140)
1280 call hchar(12,C+1,141)
1290 call hchar(13,C,142)
1300 call hchar(13,C+1,143)
1310 return

1320 Rem 9 sel - draw triple bar
1330 call hchar(12,C,144)
1340 call hchar(12,C+1,145)
1350 call hchar(13,C,146)
1360 call hchar(13,C+1,147)
1370 return

1380 REM 10 sel - draw spade
1390 call hchar(12,C,148)
1400 call hchar(12,C+1,149)
1410 call hchar(13,C,150)
1420 call hchar(13,C+1,151)
1440 return

1450 REM 11 sel - heart/Lemon
1460 call hchar(12,C,130)
1470 call hchar(12,C+1,131)
1480 call hchar(13,C,96)
1490 call hchar(13,C+1,97)
1500 return

1510 rem 12 sel lemon/bar
1520 call hchar(12,C,138)
1530 call hchar(12,C+1,139)
1540 call hchar(13,C,128)
1550 call hchar(13,C+1,129)
1560 return

1570 rem 13 sel diamond/7
1580 call hchar(12,C,107)
1590 call hchar(12,C+1,108)
1600 call hchar(13,C,92)
1610 call hchar(13,C+1,93)
1620 return

1630 rem 14 sel spade/diamond
1640 call hchar(12,C,150)
1650 call hchar(12,C+1,151)
1660 call hchar(13,C,105)
1670 call hchar(13,C+1,106)
1680 return

1690 REM 15 RED/GOLD 7
1700 call hchar(12,C,92)
1710 call hchar(12,C+1,93)
1720 call hchar(13,C,134)
1730 call hchar(13,C+1,135)
1740 return

1750 REM 16 Black Diamond
1760 call hchar(12,C,115)
1770 call hchar(12,C+1,116)
1780 call hchar(13,C,117)
1790 call hchar(13,C+1,118)
1800 return

1810 Rem 17 cherry/bell
1820 call hchar(12,C,120)
1830 call hchar(12,C+1,121)
1840 call hchar(13,C,100)
1850 call hchar(13,C+1,104)
1860 return

No comments:

Post a Comment

Merry Christmas!