“Jackpot” by Rick Blewitt is a slot-machine simulation that displays three spinning reels, each chosen from seven possible symbols: Cherry, Lemon, Orange, Star, Plum, Bar, and Bell. Each symbol is stored as an 80-character string containing a hand-drawn 8×8 block-graphic sprite built from ZX81 block characters, which are iterated in 8-character slices and printed to screen columns 1, 12, and 23. The payout logic evaluates reel combinations by summing symbol values stored in T(1)–T(3), checking for cherries first, then requiring T(1)=T(2) for most winning combinations, with a jackpot triggered by specific sums (60, 140, 180) and a random bonus for three Stars. The player starts with a chosen number of nickels and the game loops until funds run out.
Program Analysis
Program Structure
The program is organised into four broad phases:
- Initialisation (lines 100–200): Six 80-character string arrays and a 6-element numeric array are dimensioned; the symbol-building subroutine at 3000 is called.
- Title screen (lines 300–410): The BAR symbol (
J$) is tiled across three screen columns as a decorative banner, then the player is asked how many nickels to start with, stored inT(6). - Reel spin and display (lines 500–895): Three random values are drawn into
R(1)–R(3), each mapped to a symbol value inT(1)–T(3)and a display type indexA. After each reel is resolved,GOSUB 4000prints the appropriate sprite at the correct column. - Payout evaluation (lines 2000–2700): Win/loss is determined and the nickel balance updated before looping back to line 600.
Symbol Sprite Storage
Each symbol is a flat 80-character string held in one of L$, C$, O$, S$, P$, J$, or B$. The subroutine at line 4000 slices these strings in 8-character windows using a FOR R=1 TO 73 STEP 8 loop and prints each row with PRINT AT K,J;X$(R TO C). The sprites are composed of ZX81 block graphics encoded as zmakebas escape sequences (e.g. \:. = ▟, \.' = ▞) alongside literal ASCII characters, giving a recognisable pictorial appearance within the 8×8 character cell grid.
Symbol Value Encoding
Each reel result is translated to an integer “value” stored in T(1), T(2), or T(3). The mapping is:
| Value | Symbol | String variable |
|---|---|---|
| 1 | Lemon | L$ |
| 2 | Cherry | C$ |
| 10 | Orange | O$ |
| 14 | Plum | P$ |
| 18 | Bell | B$ |
| 20 | Bar | J$ |
| 60 | Star | S$ |
The payout logic at line 2000 sums T(1)+T(2)+T(3) into T(4) and checks specific totals (e.g. 30 or 40 = three oranges, 42 or 48 = three plums, 54 or 56 = three bells, 60 or 140 or 180 = jackpot). Requiring T(1)=T(2) (line 2105) as a precondition ensures only genuine three-of-a-kind combinations reach these branches. The sums 54 and 56 for bells arise because reel 3 can map the same symbol to different values (Bell=18 on reel 3 confirms), while 42 arises from 14+14+14 and 48 from e.g. mixed plum/bar mappings on different reels.
Reel Probability Distribution
Each reel draws INT(RND*10+1), producing integers 1–10 with equal probability. The three reels use different mappings, creating asymmetric odds:
- Reel 1: 1–2 → Cherry (20%), 3 → Star (10%), 4–5 → Lemon (20%), 6 → Orange (10%), 7 → Plum (10%), 8–9 → Bell (20%), 10 → Bar (10%)
- Reel 2: 1 → Lemon (10%), 2 → Star (10%), 3 → Cherry (10%), 4–6 → Orange (30%), 7–8 → Plum (20%), 9 → Bell (10%), 10 → Bar (10%)
- Reel 3: 1 → Lemon (10%), 2 → Bar (10%), 3–5 → Orange (30%), 6 → Star (10%), 7–8 → Plum (20%), 9 → Bell (10%), 10 → Bar (10%)
Payout Table
| Combination | T(4) sum | Payout (nickels) |
|---|---|---|
| One cherry (reel 1 only) | — | +2 |
| Two cherries (reels 1 & 2) | — | +5 |
| Three oranges | 30 or 40 | +10 |
| Three plums | 42 or 48 | +14 |
| Three bells | 54 or 56 | +18 |
| Three bars / two stars | 60 or 140 | +40 (jackpot) |
| Three stars | 180 | +40 + random bonus 10–59 |
Notable Techniques and Idioms
- The variable
Ais set alongside eachT(n)assignment but is never subsequently read; it appears to be a leftover debug or display-selector variable that was abandoned in the final version. T(5)is used as a temporary pass-through to carry the current reel’s symbol value into theGOSUB 4000display routine, avoiding a need for a separate parameter variable.Wis set to 3 just before the third reel’s display call (line 892) but is reset to 0 insideGOSUB 4000at line 4075 and is never read for conditional logic, suggesting another vestigial variable.- The three-reel display subroutine at 4000 uses column
J(1, 12, or 23) set by the caller, keeping a single print loop generic across all three reels. - The title banner (lines 320–375) reuses the same 8-character-slice loop idiom as the sprite renderer, printing the BAR symbol at three column positions simultaneously to create a decorative welcome screen.
- Line 2400 includes a guard:
IF T(3)=14 THEN GOTO 2590, which prevents a three-bell win when reel 3 lands on Plum (value 14) even if T(4) sums to 54, compensating for the asymmetric reel mapping.
Content
Source Code
10 REM "JACKPOT" BY RICK BLEWITT
20 SLOW
100 DIM L$(80)
110 DIM C$(80)
120 DIM O$(80)
130 DIM P$(80)
140 DIM B$(80)
150 DIM J$(80)
160 DIM X$(80)
170 LET Z=1
180 LET W=0
190 DIM T(6)
200 GOSUB 3000
300 PRINT AT 3,7;"WELCOME TO ZX JACKPOT"
305 LET K=5
310 LET X$=J$
320 FOR R=1 TO 73 STEP 8
330 LET C=R+7
340 PRINT AT K,12;X$(R TO C)
350 PRINT AT K,1;X$(R TO C)
360 PRINT AT K,23;X$(R TO C)
370 LET K=K+1
375 NEXT R
380 PRINT AT 21,8;"GET READY TO PLAY"
385 PAUSE 200
390 CLS
400 PRINT "HOW MANY NICKLES DO YOU WANT TO PLAY?"
405 PRINT AT 5,0;"INPUT NUMBER OF PLAYS--",,"THEN PRESS ENTER"
410 INPUT T(6)
500 DIM R(3)
520 DIM A$(10,10)
600 LET R(1)=INT (RND*10+1)
602 CLS
603 LET T(6)=T(6)-1
610 IF R(1)<3 THEN LET T(1)=1
611 IF T(1)=1 THEN LET A=1
612 IF R(1)<3 THEN GOTO 690
615 IF R(1)=3 THEN LET T(1)=60
617 IF T(1)=60 THEN LET A=4
618 IF R(1)=3 THEN GOTO 690
620 IF R(1)=4 OR R(1)=5 THEN LET T(1)=2
621 IF T(1)=2 THEN LET A=2
622 IF R(1)=4 OR R(1)=5 THEN GOTO 690
630 IF R(1)=6 THEN LET T(1)=10
631 IF T(1)=10 THEN LET A=3
632 IF R(1)=6 THEN GOTO 690
640 IF R(1)=7 THEN LET T(1)=14
641 IF T(1)=14 THEN LET A=4
642 IF R(1)=7 THEN GOTO 690
645 IF R(1)=8 OR R(1)=9 THEN LET T(1)=18
646 IF T(1)=18 THEN LET A=5
647 IF R(1)>10 THEN GOTO 690
650 IF R(1)=10 THEN LET T(1)=20
651 IF T(1)=20 THEN LET A=6
690 LET T(5)=T(1)
695 LET J=1
700 GOSUB 4000
710 LET R(2)=INT (RND*10+1)
720 IF R(2)=1 THEN LET T(2)=1
721 IF T(2)=1 THEN LET A=1
722 IF R(2)=1 THEN GOTO 790
725 IF R(2)=2 THEN LET T(2)=60
727 IF T(2)=60 THEN LET A=4
728 IF R(2)=2 THEN GOTO 790
730 IF R(2)=3 THEN LET T(2)=2
731 IF T(2)=2 THEN LET A=2
732 IF R(2)=3 THEN GOTO 790
740 IF R(2)=4 OR R(2)=5 OR R(2)=6 THEN LET T(2)=10
741 IF T(2)=10 THEN LET A=3
742 IF R(2)<7 THEN GOTO 790
750 IF R(2)=7 OR R(2)=8 THEN LET T(2)=14
751 IF T(2)=14 THEN LET A=4
752 IF R(2)<9 THEN GOTO 790
760 IF R(2)=9 THEN LET T(2)=18
761 IF T(2)=18 THEN LET A=5
770 IF R(2)=10 THEN LET T(2)=20
771 IF T(2)=20 THEN LET A=6
790 LET T(5)=T(2)
795 LET J=12
800 GOSUB 4000
810 LET R(3)=INT (RND*10+1)
820 IF R(3)=1 THEN LET T(3)=1
821 IF R(3)=1 THEN LET A=1
822 IF R(3)=1 THEN GOTO 890
823 IF R(3)=2 THEN LET A=6
824 IF R(3)=2 THEN LET T(3)=20
825 IF R(3)<3 THEN GOTO 890
830 IF R(3)=3 OR R(3)=4 OR R(3)=5 THEN LET T(3)=10
831 IF T(3)=10 THEN LET A=3
832 IF T(3)=10 THEN GOTO 890
835 IF R(3)=6 THEN LET T(3)=60
837 IF T(3)=60 THEN LET A=4
838 IF R(3)<7 THEN GOTO 890
840 IF R(3)=7 OR R(3)=8 THEN LET T(3)=14
841 IF T(3)=14 THEN LET A=4
842 IF T(3)=14 THEN GOTO 890
850 IF R(3)=9 THEN LET T(3)=18
851 IF T(3)=18 THEN LET A=5
852 IF T(3)=18 THEN GOTO 890
860 IF R(3)=10 THEN LET T(3)=20
861 IF T(3)=20 THEN LET A=6
890 LET T(5)=T(3)
891 LET J=23
892 LET W=3
895 GOSUB 4000
900 GOTO 2000
910 PAUSE 300
990 GOTO 600
\n2000 LET T(4)=T(1)+T(2)+T(3)
\n2010 IF T(1)<>2 THEN GOTO 2100
\n2020 IF T(2)=2 THEN GOTO 2050
\n2030 PRINT AT 4,1;"ONE CHERRY WINS 10 CENTS"
\n2035 LET T(6)=T(6)+2
\n2040 GOTO 2600
\n2050 PRINT AT 4,1;"TWO CHERRIES WIN 25 CENTS"
\n2060 LET T(6)=T(6)+5
\n2070 GOTO 2600
\n2100 IF T(4)<30 THEN GOTO 2590
\n2105 IF T(1)<>T(2) THEN GOTO 2590
\n2110 IF T(4)=30 OR T(4)=40 THEN GOTO 2500
\n2120 IF T(4)=42 OR T(4)=48 THEN GOTO 2450
\n2130 IF T(4)=54 OR T(4)=56 THEN GOTO 2400
\n2140 IF T(4)=60 OR T(4)=140 THEN GOTO 2350
\n2150 IF T(4)=180 THEN GOTO 2350
\n2190 GOTO 2590
\n2350 PRINT AT 4,1;"*****JACKPOT*****PAYS 40 NICKLES"
\n2360 LET T(6)=T(6)+40
\n2365 IF T(4)=60 OR T(4)=140 THEN GOTO 2600
\n2370 IF T(4)=180 THEN PRINT AT 5,1;"***3 STARS=JACKPOT + BONUS"
\n2375 LET B=INT (RND*50+10)
\n2380 PRINT AT 6,6;"BONUS = ";B;" NICKLES"
\n2385 LET T(6)=T(6)+B
\n2390 GOTO 600
\n2400 IF T(3)=14 THEN GOTO 2590
\n2405 PRINT AT 4,1;"THREE BELLS PAY 18 NICKLES"
\n2410 LET T(6)=T(6)+18
\n2420 GOTO 2600
\n2450 PRINT AT 4,1;"THREE PLUMS PAY 14 NICKLES"
\n2460 LET T(6)=T(6)+14
\n2470 GOTO 2600
\n2500 PRINT AT 4,1;"THREE ORANGES PAY 10 NICKLES"
\n2510 LET T(6)=T(6)+10
\n2520 GOTO 2600
\n2590 PRINT AT 4,1;"SORRY: YOU LOSE"
\n2600 PRINT AT 2,1;"PLAY NICKLE JACKPOT";" PLAY NO. ";Z
\n2620 IF T(6)=1 THEN PRINT AT 20,1;"YOU ARE DOWN TO THE LAST TRY."
\n2621 IF T(6)<>1 THEN PRINT AT 20,1;"YOU HAVE ";T(6);" NICKLES LEFT"
\n2625 IF T(6)>0 THEN GOTO 2650
\n2630 PRINT AT 20,1;"YOU ARE BROKE, GET SOME MORE MONEY AND PLAY AGAIN."
\n2640 STOP
\n2650 PRINT " PLAY AGAIN"
\n2660 LET Z=Z+1
\n2690 PAUSE 100
\n2700 GOTO 600
\n3000 LET C$="********* \: ** \: ** \.'\'. ** \.' \'. **\.:\:. \.:\:.*\ '% % \' \ '% % \' *\ '\' \ '\' *\,,\,,\,,\,,\,,\,,\,,\,,\@@CHERRY\@@"
\n3100 LET L$="********* ** \..\.. **\ .\:'\' \ '\':\. **\':\. \ .\:'** \''\:.\.:\'' ** ** *\,,\,,\,,\,,\,,\,,\,,\,,\@@LEMON:\@@"
\n3200 LET O$="********* \..\:'\':\.. **\ :\' \ '\: **\:' \':**\: \ :**\': \:'**\ '\: \ :\' ** \''\:.\.:\'' *\,,\,,\,,\,,\,,\,,\,,\,,\@@ORANGE\@@"
\n3300 LET S$="********* \ :\: ** \ :\: **\:.\. \.:\:.\ .\.:**\ '% % % % \' ** \ :\:'\':\: **\ .\:' \':\. **\:' \':*\,,\,,\,,\,,\,,\,,\,,\,,\@@\@@STAR\@@\@@"
\n3400 LET P$="********* ** \..\.. **\ .\.:% % \:.\. **\':% % % % \:'** \ '% % \' ** ** *\,,\,,\,,\,,\,,\,,\,,\,,\@@\@@PLUM\@@\@@"
\n3500 LET J$="********* **% % % % % % **% % % % % % ***BAR****% % % % % % **% % % % % % ** *\,,\,,\,,\,,\,,\,,\,,\,,\@@\@@BAR\@@\@@\@@"
\n3600 LET B$="********* \ .\. ** \ .\.:\:.\. **\ .\' \ '\. **\ : \: **\ : \: **\.' \'.**\''\''\':\:'\''\''*\,,\,,\,,\,,\,,\,,\,,\,,\@@\@@BELL\@@\@@"
\n3990 RETURN
\n4000 LET X=T(5)
\n4001 LET K=7
\n4005 LET X$=L$
\n4010 IF X=2 THEN LET X$=C$
\n4020 IF X=5 THEN LET X$=C$
\n4030 IF X=10 THEN LET X$=O$
\n4040 IF X=14 THEN LET X$=P$
\n4050 IF X=18 THEN LET X$=B$
\n4060 IF X=20 THEN LET X$=J$
\n4070 IF X=60 THEN LET X$=S$
\n4075 LET W=0
\n4080 FOR R=1 TO 73 STEP 8
\n4090 LET C=R+7
\n4100 PRINT AT K,J;X$(R TO C)
\n4105 LET K=K+1
\n4110 NEXT R
\n4120 RETURN
\n9997 STOP
\n9998 SAVE "SLOT-MACHIN%E"
\n9999 RUN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

