Cheapo Keno
- Type
- Game
- Category
- Casino game (Keno)
- Author
- Maximillian Eissler and Chester Wozniak
- Published in
- Antic, July 1988 (Vol. 7, No. 3)
- Year
- 1988
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit of any memory size, Atari BASIC, joystick in port 1; disk or cassette
- Tags
- antic, keno, gambling, casino, joystick, display-list, graphics-0, graphics-1, 1988
About the program
Cheapo Keno was Antic's "Bonus Game" in July 1988, an issue that also carried King Keno, a bigger commercial-style version, on its Super Disk. The authors were Maximillian Eissler, a retired Norwegian Air Force pilot, and Chester Wozniak, director of security at a country club, who lived in Cathedral City and worked in Rancho Mirage, California. It was their first piece in Antic. The article's tongue-in-cheek introduction tells how a Keno habit had cost the writer his car, his house and his family, until a long walk home from Las Vegas gave him the idea of feeding the habit on his Atari instead. (The board's own title calls it "Chet and the Iceman's Keno".)
The game works like a casino Keno machine. You bet one to four quarters, mark one to ten numbers on an 80-number grid and start the draw. The computer then picks 20 numbers, and the more of yours it catches, the more you win. The article says it runs on any Atari 8-bit, with disk or cassette. It also suggests using it as a safe place to try out a Keno "system".
Typing it in
The board is drawn with the Atari's line-graphics characters, so the listing is full of control characters: {CTRL-Q}, {CTRL-R}, {CTRL-W}, {CTRL-E}, {CTRL-A}, {CTRL-S}, {CTRL-D}, {CTRL-Z}, {CTRL-X} and {CTRL-C} (hold CTRL and press the letter). A marked number is shown as the pair {CTRL-I}{CTRL-F}, in inverse in some lines. The vertical box labels are printed with cursor moves: {DOWN} and {LEFT} mean press ESC, then CTRL with the arrow key. {CLEAR} is ESC then SHIFT-CLEAR, and {BELL} is ESC then CTRL-2. Text between {inv} and {/inv} is typed in inverse video (the Atari or reverse-video key). The magazine printed the listing with TYPO II checksums, which aren't in the disk version shown here.
How to play
When it starts, the cursor sits in the BET box and the title flashes. Each press of the button raises the bet by 25 cents, up to $1.00. Move the cursor onto a number and press the button to mark it. The top line counts your spots. ERASE clears all your marks, and PAY shows the pay table for the number of spots you've marked, with your total bets and winnings and whether you're ahead or down. When you're ready, move to START and press the button.
Picking more numbers raises the jackpot and lengthens the odds. One spot out of one is about a one-in-four chance. Ten out of ten, the authors wrote, is like knocking a fly off a pig's back with a slingshot at 100 yards while standing on your head on a merry-go-round.
How it works
- Two screens. Line 5 lowers RAMTOP (location 106) by eight pages before the second
GRAPHICS 0. The program then rebuilds the first screen's display list (lines 40–50) into a GRAPHICS 1-style screen (ANTIC mode 6). That spare screen holds the payoff table. Lines 480–482 and 1185–1190 switch between the two screens by changing the display-list pointer (560/561) and the screen-memory pointer (88/89), so the board never has to be redrawn. - Mixed modes on the board. Line 30 changes three lines of the main display list to mode 6. That's how the large title and the bottom caption share the screen with the 40-column grid.
- Money is counted in quarters. Bets, wins and the DATA in lines 1001–1010 are whole numbers of quarters. Line 1000+n holds the table for n spots: first the smallest catch that pays, then the payout for each catch from there up. Because Atari BASIC can't format numbers, lines 950–960 and 1120–1175 add the missing ".00" or "0" when they print dollars.
- The draw. Lines 650–695 pick 20 different numbers, using the
CG()array to reject repeats. A hit is shown with the marker, and the "hits" counter goes up. The win is then paid out in random handfuls of coins, each with a clink, and anything over $40 is paid in one go (lines 930–980). - BREAK protection. Line 180 turns off the BREAK key by changing POKMSK (16) and IRQEN (53774). If SELECT is held down when you type RUN, line 5 notices and leaves BREAK working, which is handy while you're debugging.
Variations to try
You could change the pay tables in lines 1001–1010 to match a real casino's card, or raise the bet limit in line 230. Another idea is to keep the bets and winnings counters going across several sessions by writing them to disk.
Changes from the published listing
One change, so the program also runs under Altirra BASIC, the free replacement BASIC built into many emulators. Altirra BASIC adds a command called CP, so it rejected the published lines that use that word as the start of a variable name. The variable is renamed everywhere in the program. The new name is the same length, so the memory layout is unchanged and the program behaves exactly as published on genuine Atari BASIC. If you type it in from the magazine, the original names work fine on a real Atari.
| Published | Now | Lines |
|---|---|---|
CP |
KP |
10, 680, 805 |
Listing
2 REM CHEAPO KENO
3 REM BY MAXIMILLIAN EISSLER AND CHESTER WOZNIAK
4 REM (c)1988, ANTIC PUBLISHING INC.
5 A=PEEK(106)-8:BRK=(PEEK(53279)=5):DL1LO=PEEK(560):DL1HI=PEEK(561):SCR=(A+4)*256:GRAPHICS 0:REM ALT SCREEN
6 POKE 106,A:DIS=DL1LO+DL1HI*256:SAVMSCL=PEEK(88):SAVMSCH=PEEK(89)
10 DIM GUESS(80),CR(10),CG(80),A$(10),KP(20):TBETS=0:TWINS=0:NGS=0:CG=0
13 FOR A=0 TO 80:GUESS(A)=0:NEXT A
15 GRAPHICS 0:GOSUB 180:POKE 709,112:POKE 710,120:POKE 712,120:POKE 711,252:POKE 764,255:POKE 752,2
16 ? :POKE 82,0:POKE 708,50:SM1=PEEK(88):SM2=PEEK(89)
19 REM INCLUDE GR.1 IN DL.
20 DIS1=PEEK(560):DIS2=PEEK(561)
30 A=DIS1+256*DIS2:POKE A+6,6:POKE A+7,6:POKE A+28,6
40 POKE DIS,112:POKE DIS+1,112:POKE DIS+2,112:POKE DIS+3,70:POKE DIS+4,SAVMSCL:POKE DIS+5,SAVMSCH
50 FOR A=6 TO 28:POKE DIS+A,6:NEXT A:POKE DIS+29,65:POKE DIS+30,DL1LO:POKE DIS+31,DL1HI
60 SCS=SCR+39:SCL=SCR+479:FOR A=SCS TO SCL STEP 40:POKE A,0:NEXT A
100 ? "{CLEAR}":POSITION 4,3:? "{CTRL-Q}";:FOR A=1 TO 9:? "{CTRL-R}{CTRL-R}{CTRL-W}";:NEXT A:? "{CTRL-R}{CTRL-R}{CTRL-E}"
110 FOR A=1 TO 4
120 POSITION 4,A*2+2:? "|";:FOR B=1 TO 10:IF A=1 AND B<10 THEN ? "0";B;:GOTO 140
130 ? (A-1)*10+B;
140 ? "|";:NEXT B
150 POSITION 4,A*2+3:? "{CTRL-A}";:FOR B=1 TO 10:? "{CTRL-R}{CTRL-R}{CTRL-S}";:NEXT B:? "{LEFT}{CTRL-D}":NEXT A
151 POSITION 4,11:? "{CTRL-Z}";:FOR A=1 TO 10:? "{CTRL-R}{CTRL-R}{CTRL-X}";:NEXT A:? "{LEFT}{CTRL-C}"
152 POSITION 4,12:? "{CTRL-Q}";:FOR A=1 TO 9:? "{CTRL-R}{CTRL-R}{CTRL-W}";:NEXT A:? "{CTRL-R}{CTRL-R}{CTRL-E}"
153 FOR A=5 TO 8
154 POSITION 4,A*2+3:? "|";:FOR B=1 TO 10:? (A-1)*10+B;"|";:NEXT B
155 POSITION 4,A*2+4:? "{CTRL-A}";:FOR B=1 TO 10:? "{CTRL-R}{CTRL-R}{CTRL-S}";:NEXT B:? "{LEFT}{CTRL-D}":NEXT A
160 POSITION 4,20:? "{CTRL-Z}";:FOR A=1 TO 10:? "{CTRL-R}{CTRL-R}{CTRL-X}";:NEXT A:? "{LEFT}{CTRL-C}"
163 POKE 764,255:IF SAME=1 THEN 950
164 DATA 1,4,5,1,13,5,35,5,3,35,14,3
165 A$="|{DOWN}{LEFT}{LEFT}{LEFT}| ":RESTORE 164:FOR E=1 TO 4:READ B,C,D:GOSUB 195:? "{LEFT}{LEFT}{CTRL-Z}{CTRL-R}{CTRL-C}":NEXT E
166 FOR A=4 TO 34:POSITION A,2:? "{CTRL-R}":POSITION A,21:? "{CTRL-R}":NEXT A:FOR A=3 TO 20
167 POSITION 3,A:? CHR$(124-120*(A=4 OR A=10 OR A=13 OR A=19)):POSITION 35,A
168 ? CHR$(124-123*(A=5 OR A=9 OR A=14 OR A=18)):NEXT A:POSITION 3,2:? "{CTRL-Q}":POSITION 35,2:? "{CTRL-E}"
169 POSITION 3,21:? "{CTRL-Z}":POSITION 35,21:? "{CTRL-C}":FOR A=1 TO 4:ON A GOSUB 170,171,172,173:NEXT A:GOTO 2000
170 POSITION 2,14:? "E{DOWN}{LEFT}R{DOWN}{LEFT}A{DOWN}{LEFT}S{DOWN}{LEFT}E":RETURN
171 POSITION 2,5:? "S{DOWN}{LEFT}T{DOWN}{LEFT}A{DOWN}{LEFT}R{DOWN}{LEFT}T":RETURN
172 POSITION 36,6:? "B{DOWN}{LEFT}E{DOWN}{LEFT}T":RETURN
173 POSITION 36,15:? "P{DOWN}{LEFT}A{DOWN}{LEFT}Y":RETURN
175 POSITION 2,14:? "{inv}E{/inv}{DOWN}{LEFT}{inv}R{/inv}{DOWN}{LEFT}{inv}A{/inv}{DOWN}{LEFT}{inv}S{/inv}{DOWN}{LEFT}{inv}E{/inv}":RETURN
176 POSITION 2,5:? "{inv}S{/inv}{DOWN}{LEFT}{inv}T{/inv}{DOWN}{LEFT}{inv}A{/inv}{DOWN}{LEFT}{inv}R{/inv}{DOWN}{LEFT}{inv}T{/inv}":RETURN
177 POSITION 36,6:? "{inv}B{/inv}{DOWN}{LEFT}{inv}E{/inv}{DOWN}{LEFT}{inv}T{/inv}":RETURN
178 POSITION 36,15:? "{inv}P{/inv}{DOWN}{LEFT}{inv}A{/inv}{DOWN}{LEFT}{inv}Y{/inv}":RETURN
180 POKE 77,0:IF NOT (BRK) THEN POKE 16,112:POKE 53774,112
190 RETURN
195 POSITION B,C:? "{CTRL-Q}{CTRL-R}{CTRL-E}{DOWN}{LEFT}{LEFT}{LEFT}| ";:FOR A=1 TO D:? A$;:NEXT A:RETURN
200 REM BETTING SUBROUTINE
205 GOSUB 177
207 FOR A=1 TO 25:NEXT A
210 J=STICK(0):IF J=9 OR J=10 OR J=11 THEN 300
212 IF J=13 OR J=14 AND BET>0 THEN NUM=70:GOSUB 172:FOR A=1 TO 20:NEXT A:GOTO 460
214 IF J<9 AND BET>0 THEN NUM=11:GOSUB 172:GOTO 432
220 IF STRIG(0)=1 THEN 210
230 IF BET=4 THEN ? "{BELL}";:GOTO 210
240 BET=BET+1
245 FOR A=13 TO 0 STEP -1:SOUND 0,2,10,A:SOUND 1,2,6,A:NEXT A
250 POSITION 10,22:? "BET $";:GOTO 250+BET
251 ? "0.25";:GOTO 255
252 ? "0.50";:GOTO 255
253 ? "0.75";:GOTO 255
254 ? "1.00";
255 FOR A=0 TO 100:NEXT A:GOTO 210
259 REM ERASE NUMBERS SUBROUTINE
260 GOSUB 175:FOR A=1 TO 25:NEXT A
261 J=STICK(0):IF J<9 THEN GOSUB 170:GOTO 350
263 IF J<13 AND J>7 THEN GOSUB 170:NUM=70:GOTO 460
265 IF J=13 OR J=14 THEN GOSUB 170:NUM=11:GOTO 432
267 IF NGS=0 THEN 261
268 IF STRIG(0)=1 THEN 261
269 SOUND 0,50,10,4:FOR A=1 TO 25:NEXT A:SOUND 0,0,0,0
270 NGS=0:TNUM=NUM:FOR NUM=1 TO 80:IF GUESS(NUM)=1 THEN GUESS(NUM)=0:GOSUB 500:GOSUB 530
275 NEXT NUM:NUM=TNUM:POSITION 2,1:? "0 {inv}spots{/inv} 0 {inv}hits{/inv} ":GOTO 261
300 IF BET=0 THEN 210
310 GOSUB 172
349 REM MAIN ROUTINE
350 GOSUB 500:IF GUESS(NUM)=1 THEN ? "{inv}{CTRL-I}{CTRL-F}{/inv}":GOTO 360
353 POKE 77,0
355 GOSUB 510
360 CG=RND(1):IF STRIG(0)=0 AND GUESS(NUM)=0 AND NGS<10 THEN 600
370 J=STICK(0):IF J=15 THEN 360
375 GOSUB 500:IF GUESS(NUM)=1 THEN ? "{CTRL-I}{CTRL-F}":GOTO 385
380 GOSUB 530
385 IF NUM-INT(NUM/10)*10=1 THEN 425
390 IF NUM/10=INT(NUM/10) THEN 450
395 IF NUM<11 AND J<>6 AND J<>10 AND J<>14 THEN 405
397 IF NUM<11 THEN NUM=NUM+70-(J=10)+(J=6):GOTO 420
400 IF NUM>70 AND J<>9 AND J<>5 AND J<>13 THEN 405
402 IF NUM>70 THEN NUM=NUM-70-(J=9)+(J=5):GOTO 420
405 NUM=NUM-(J=9 OR J=11 OR J=10)+(J=5 OR J=6 OR J=7)-10*(J=10 OR J=14 OR J=6)+10*(J=9 OR J=5 OR J=13)
420 GOTO 350
425 IF J>11 OR J<9 THEN 395
430 IF NUM>40 THEN 260
432 GOSUB 176:FOR A=1 TO 25:NEXT A
433 J=STICK(0):IF J<9 THEN GOSUB 171:GOTO 350
435 IF J<13 AND J>7 THEN NUM=20:GOSUB 171:GOTO 205
437 IF J=13 OR J=14 THEN NUM=51:GOSUB 171:GOTO 260
439 IF STRIG(0)=1 THEN 433
440 IF NGS=0 THEN 433
443 SOUND 0,50,10,4:FOR A=1 TO 25:NEXT A:SOUND 0,0,0,0
445 GOTO 650
450 IF J>7 THEN 395
455 IF NUM<50 THEN 205
460 GOSUB 178
465 FOR A=1 TO 25:NEXT A
470 J=STICK(0):IF J<13 AND J>7 THEN GOSUB 173:GOTO 350
472 IF J=13 OR J=14 THEN NUM=20:GOSUB 173:GOTO 205
473 IF J<9 THEN NUM=51:GOSUB 173:GOTO 430
475 IF STRIG(0)=1 THEN 470
476 IF NGS=0 THEN 470
477 SOUND 0,50,10,4:FOR A=1 TO 25:NEXT A:SOUND 0,0,0,0
478 POKE 559,0
479 REM THE PAYOFF SCREEN USES SEPERATE MEMORY TO AVOID HAVING TO REDRAW EA. TIME
480 POKE 560,DL1LO:POKE 561,DL1HI
482 POKE 88,SAVMSCL:POKE 89,SAVMSCH
483 POSITION 0,0:? "{CLEAR}"
484 POSITION 0,0:FOR A=0 TO 20:? " ":NEXT A
485 POKE 559,34
490 GOTO 1100
500 Y=INT((NUM-1)/10):X=NUM-Y*10:POSITION X*3+2,Y*2+4+(NUM>40):RETURN
510 IF NUM<10 THEN ? "{inv}0{/inv}";:GOTO 520
515 ? CHR$(INT(NUM/10)+176);
520 ? CHR$(NUM-INT(NUM/10)*10+176);:RETURN
530 IF NUM<10 THEN ? "0";
535 ? NUM;:RETURN
600 GUESS(NUM)=1:NGS=NGS+1:GOSUB 500:? "{inv}{CTRL-I}{CTRL-F}{/inv}":FOR A=1 TO 25:SOUND 0,100,10,10:NEXT A:SOUND 0,0,0,0
610 POSITION 2,1:? NGS;" {inv}spots{/inv} 0 {inv}hits{/inv}":GOTO 370
649 REM TIME FOR THE COMPUTER TO PICK NUMBERS
650 TBETS=TBETS+BET:HIT=0:FOR A=0 TO 80:CG(A)=0:NEXT A:NCG=0
660 FOR A=1 TO 20:FOR B=1 TO 15:NEXT B
670 CG=INT(80*RND(1)+1):IF CG(CG)=1 THEN 670
680 KP(A)=CG:CG(CG)=1:IF GUESS(CG)=0 THEN SOUND 0,150,10,4:NUM=CG:GOSUB 500:GOSUB 510:GOSUB 695:NEXT A:GOTO 700
685 CR(HIT+1)=CG
690 NUM=CG:HIT=HIT+1:SOUND 0,100,10,10:GOSUB 500:? "{inv}{CTRL-I}{CTRL-F}{/inv}"
691 POSITION 2,1:? NGS;" {inv}spots{/inv} ";HIT;" {inv}hits{/inv}":GOSUB 695:NEXT A:GOTO 700
695 FOR B=1 TO 20:NEXT B:SOUND 0,0,0,0:RETURN
699 REM FLASH HITS UNTIL BET IS MADE
700 IF HIT=0 THEN 790
701 RESTORE 1000+NGS:READ A:IF HIT>=A THEN 900
705 GOSUB 171:GOSUB 177:BET=0
710 FOR A=1 TO HIT:NUM=CR(A):GOSUB 500:? "{inv} {/inv}":IF STRIG(0)=0 THEN 800
720 NEXT A
740 FOR A=1 TO HIT:NUM=CR(A):GOSUB 500:? "{inv}{CTRL-I}{CTRL-F}{/inv}":IF STRIG(0)=0 THEN 800
750 NEXT A
770 GOTO 710
790 GOSUB 171:GOSUB 177
795 IF STRIG(0)=1 THEN 795
799 REM RESET SCREEN AND SHOW FIRST BET
800 FOR A=13 TO 0 STEP -1:SOUND 0,2,10,A:SOUND 1,2,6,A:NEXT A:POSITION 0,22:? " ";
803 POSITION 10,22:? "BET $0.25";:POSITION 2,1:? NGS;" {inv}spots{/inv} 0 {inv}hits{/inv} "
805 FOR A=1 TO 20:NUM=KP(A):IF GUESS(NUM)=0 THEN GOSUB 500:GOSUB 530
810 IF GUESS(NUM)=1 THEN GOSUB 500:? "{CTRL-I}{CTRL-F}"
820 NEXT A:NUM=20:BET=1:GOTO 250
899 REM PAYOUT COINS
900 FOR B=1 TO HIT-A+1:READ C:NEXT B:C=C*BET:TWINS=TWINS+C
910 POSITION 0,22:? "PAY";
920 A=0
930 D=INT(RND(1)*8):A=A+D:IF A>C THEN D=C-A+D:A=C
940 POSITION 4-(A>39)-(A>399)-(A>3999)-(A>39999),22:? "$";A/4;
950 IF A/4=INT(A/4) THEN ? ".00";
960 IF A/4-INT(A/4)=0.5 THEN ? "0";
969 IF D=1 THEN 972
970 IF D=0 THEN 980
971 FOR B=1 TO D-1:FOR E=13 TO 5 STEP -1:SOUND 0,1,10,E:SOUND 1,1,2,E:NEXT E:NEXT B
972 FOR B=13 TO 0 STEP -1:SOUND 0,1,10,B:SOUND 1,1,2,B:NEXT B
976 IF A<>C AND A>160 THEN A=C:D=0:GOTO 940
980 IF A<>C THEN 930
990 GOTO 705
1000 REM PAYOFF DATA
1001 DATA 1,3
1002 DATA 2,12
1003 DATA 2,1,44
1004 DATA 2,1,2,160
1005 DATA 3,1,8,900
1006 DATA 3,1,4,80,2200
1007 DATA 3,1,2,20,200,6000
1008 DATA 4,1,7,80,1500,10000
1009 DATA 4,1,4,40,280,2800,10000
1010 DATA 5,1,20,160,1000,7000,10000
1099 REM PAYOFF SCREEN
1100 POSITION 1,0:? "marked ";NGS
1105 POSITION 1,1:? "catch pay"
1110 RESTORE 1000+NGS:READ A:FOR B=A TO NGS:READ C
1120 POSITION 1,2+B-A:? B:POSITION 9,2+B-A:D=C*BET:? "$";D/4;:IF INT(D/4)=D/4 THEN ? ".00";
1130 IF D/4-INT(D/4)=0.5 THEN ? "0";
1140 NEXT B:? :? :? "bets $";TBETS/4;:IF INT(TBETS/4)=TBETS/4 THEN ? ".00";
1145 IF TBETS/4-INT(TBETS/4)=0.5 THEN ? "0";
1150 ? :? "winnings $";TWINS/4;:IF INT(TWINS/4)=TWINS/4 THEN ? ".00";
1155 IF TWINS/4-INT(TWINS/4)=0.5 THEN ? "0";
1160 IF TBETS=TWINS THEN ? :? "even";:GOTO 1180
1165 ? :IF TBETS>TWINS THEN ? "down ";:GOTO 1170
1167 ? "ahead ";
1170 DIF=ABS(TBETS-TWINS):? "$";DIF/4;:IF INT(DIF/4)=DIF/4 THEN ? ".00";
1175 IF DIF/4-INT(DIF/4)=0.5 THEN ? "0";
1180 ? :? :? "{inv}press trigger{/inv}";
1183 FOR A=1 TO 25:NEXT A
1184 IF STRIG(0)=1 THEN 1184
1185 POKE 559,0:POKE 88,SM1:POKE 89,SM2
1190 POKE 560,DIS1:POKE 561,DIS2:POKE 559,34:FOR A=1 TO 50:NEXT A:GOTO 470
1999 REM OPENING
2000 GOSUB 177:BET=0:NUM=20
2001 POSITION 0,22:? "A ME AND XE PROGRAM";
2005 POSITION 0,1:? "{inv}chet and the icemans{/inv} keno":GOSUB 2015
2010 POSITION 27,1:? "KENO":GOSUB 2015:GOTO 2005
2015 CG=RND(1):IF STRIG(0)=1 THEN RETURN
2020 POP :POSITION 0,1:? " 0 {inv}spots{/inv} 0 {inv}hits{/inv} "
2025 POSITION 0,22:? " ";
2030 GOTO 240
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: KENO.BAS.
Credits
- Program listing: Cheapo Keno — program listing (Antic, July 1988 (Vol. 7, No. 3)) — Maximillian Eissler and Chester Wozniak
- Picture: The Keno board with its START, ERASE, BET and PAY boxes, waiting for the first bet. — Maximillian Eissler and Chester Wozniak (program); screenshot by the site
- Antic magazine scan (OCR text layer), July 1988, pp. 9-11 and 29: Cheapo Keno, by Maximillian Eissler and Chester Wozniak — Maximillian Eissler; Internet Archive, 1988
- Antic Software Archive — July 1988 - Vol. 7 No. 3 disk: KENO.BAS — Maximillian Eissler and Chester Wozniak, 1988
