--- title: "Keno" id: 55022 type: "computer_media" slug: "keno-2" url: "http://localhost/computer_media/keno-2/" markdown_url: "http://localhost/computer_media/keno-2.md" published_at: "2024-06-10T07:31:01+00:00" modified_at: "2026-04-03T07:59:08+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Pick up to 10 numbers from 80, watch the computer draw 20, and see if you can win the $25,000 jackpot in this complete Keno casino simulation." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" - name: "Games" slug: "games" taxonomy: "category" url: "http://localhost/category/software/games/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Thomas Arbster" slug: "thomas-arbster" taxonomy: "indiv" url: "http://localhost/indiv/thomas-arbster/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Program" programmers: - name: "Thomas Arbster" slug: "thomas-arbster" taxonomy: "indiv" url: "http://localhost/indiv/thomas-arbster/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Keno%20%28198x%29%28Arbster%2C%20Tom%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "198x" media_type_tags: "Game" --- Keno is a lottery-style gambling simulation where the player selects 1 to 10 numbers from a field of 80, then the computer randomly draws 20 numbers and awards payoffs based on how many the player matched. The program uses individual scalar variables (A through J and AA through AT) rather than arrays to store both the player’s chosen numbers and the 20 dealer draws, which is a common workaround given the absence of array support in early BASIC dialects. A duplicate-entry check covers combinations for the first six player numbers using a series of pairwise comparisons at lines 211–225. The game includes an introductory background text on Keno’s history, a multi-page payoff schedule display, and a special “auto-replay” mode triggered by manually setting XX=100 from the command line. The purse starts at $20, each play costs $1, and maximum winnings reach $25,000 for matching all 10 numbers. *** ## Program Analysis ### Program Structure The program is organized into clearly separated subroutine blocks with a main flow driven by `GOSUB` calls at lines 2–9. Execution begins with a title screen (`GOSUB 1200`), initialization (`GOSUB 3000`), the introduction/menu (`GOSUB 5000`), another title screen, then the main game loop entry at line 6000 (instructions) or line 10 (play). The overall structure is: - Lines 1–9: Main entry and game loop dispatch - Lines 10–299: Game play flow (number entry, same-numbers path, draw display, hit counting) - Lines 299–640: Hit evaluation, payoff calculation, and play-again prompt - Lines 900–1020: Hit counter subroutine - Lines 1050–1060: Variable reset subroutine - Lines 1100–1110: Exit/thank-you screen - Lines 1200–1280: Title banner subroutine - Lines 1300–1395: Number grid display subroutine - Lines 1500–1560: Duplicate-entry (cheating) detection and scroll - Lines 1850–1853: Purse status display - Lines 1900–2275: Dealer draw loop (20 random numbers, hit detection) - Lines 2300–2400: Player variable initialization subroutine - Lines 3000–3035: Game initialization (purse, play cost) - Lines 3200–3547: Key-press input for number-of-spots selection - Lines 5002–5029: Introduction text and history - Lines 5029–5065: Main menu (play / instructions / payoff schedule) - Lines 6000–6195: Instructions display - Lines 7000–7566: Payoff schedule display (three pages) - Line 9999: Diagnostic `PRINT PEEK` (vestigial debug line) ### Variable Storage Strategy Rather than using arrays, the program stores player picks in individual variables `A` through `J` (10 maximum), and the 20 dealer draws in variables `AA` through `AT`. Both sets are pre-initialized to negative sentinel values (−1 through −10 for player variables at lines 2300–2390, and −1 through −20 for dealer variables at lines 1900–1995) so that unset slots cannot accidentally match any valid number in the range 1–80. This is a deliberate and effective technique given that BASIC on this platform lacks a convenient way to declare and clear arrays without DIM. ### Duplicate Entry Detection Lines 211–225 perform pairwise comparisons to detect duplicate player entries. However, coverage is incomplete: only the first six variables (A–F) are checked against each other (15 pairs total). Variables G, H, I, and J (picks 7–10) are never tested for duplicates against any other variable. Any duplicate entered as pick 7, 8, 9, or 10 will silently pass through, making the anti-cheat logic only partially effective. ### Dealer Draw Deduplication The 20 dealer numbers are generated in a loop at lines 2000–2093. Each candidate value `Y` is checked against all 20 previously stored dealer variables (lines 2050–2069) before being accepted, ensuring no repeated dealer numbers. The rejection loop goes back to `2020` to regenerate. This is a standard rejection-sampling approach. ### Hit Detection Hit counting is performed at lines 2260–2269 for each of the 20 dealer draws. For each dealer number `Y`, the program checks it against all 10 player variables individually with `IF Y=A THEN GOSUB 1000`, etc. The hit counter subroutine at line 1000 increments `X` and prints an asterisk. Notably, variable `X` is not initialized before the draw loop—it is initialized in the `GOSUB 1050` at line 34 (which sets `X=0`), or at line 900 for the “same numbers” path. The separate initialization at line 3002 also covers first-run startup. ### Payoff Calculation Lines 400–541 contain a comprehensive truth table of `IF K=spots AND X=hits THEN LET W=amount` statements covering all meaningful combinations of spots played (1–10) and hits achieved. Each tier also has a catch-all `IF K=n AND X