--- title: "LOTTO" id: 72877 type: "computer_media" slug: "lotto-4" url: "http://localhost/computer_media/lotto-4/" markdown_url: "http://localhost/computer_media/lotto-4.md" published_at: "2026-10-27T15:54:33+00:00" modified_at: "2026-10-27T15:54:33+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/l-2.png" excerpt: "A fast lottery number picker that prints up to ten lines of six different numbers from 1 to 44 inside a flashing border." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Michael DiRienzo" slug: "michael-dirienzo" taxonomy: "indiv" url: "http://localhost/indiv/michael-dirienzo/" genre: - name: "Gambling" slug: "gambling" taxonomy: "genre" url: "http://localhost/type/gambling/" media_type: "Program" programmers: - name: "Michael DiRienzo" slug: "michael-dirienzo" taxonomy: "indiv" url: "http://localhost/indiv/michael-dirienzo/" download_url: "https://archive.org/download/timex-sinclair-software-archive/LOTTO%20%281990%29%28DiRienzo%2C%20Michael%29%28TS2068%29%28US%29%28Program%29.zip" tsrun_member: "LOTTO (1990)(DiRienzo, Michael)(TS2068)(US)(Program)/LOTTO (1990)(DiRienzo, Michael)(TS2068)(US)(Program).tap" mediadate: "1990" images: - url: "http://localhost/wp-content/uploads/2026/10/l-2.png" article_media: - id: 23349 title: "Mike’s Notebook: LOTTO" type: "article" url: "http://localhost/article/mikes-notebook-lotto/" - id: 44728 title: "Mike’s Notebook: LOTTO" type: "article" url: "http://localhost/article/mikes-notebook-5/" - id: 45511 title: "Mike’s Notebook: LOTTO" type: "article" url: "http://localhost/article/mikes-notebook-16/" related_content: - id: 35715 title: "Mike’s Notebook" type: "document" url: "http://localhost/document/mikes-notebook/" media_type_tags: "Gambling" license: false --- # LOTTO LOTTO draws a flashing chequered border and asks how many lines to pick, from one to ten. For each line it chooses six different numbers from 1 to 44 and prints them in ascending order, with a beep, then wishes the player good luck. The column explains how to change the range and the number of picks for other state lotteries: the range is in lines 40, 60 and 120 and the number of picks in lines 50 and 130. It ran in Michael J. DiRienzo’s Mike’s Notebook column of August 1990. ## Program Analysis - Lines 1–5 draw the border with block graphics `CHR$ 143` and `CHR$ 128`, printed with `FLASH 1`. - Lines 40–90 mark six distinct random numbers in the array `s(44)`, repicking any number already used. - Lines 110–140 scan the array in order, so the numbers come out sorted without a sort routine. ## Notable Techniques - `DIM s(44)` is re-executed for each line, which clears the flags. - `"," AND c<6` prints a comma after every number except the sixth. Typed in from the Mike’s Notebook column on RMG Enterprises’ monthly RMG UPDATES disk for August 1990, where the program exists only as a listing in the column’s text. It was tokenized for tape and tested in ZEsarUX. ## Source Code ``` 1 BORDER 4: PAPER 0: CLS : PAPER 1: INK 6 2 FOR x=0 TO 31 STEP 2 3 PRINT FLASH 1;AT 0,x;CHR$ 143;CHR$ 128;AT 21,30-x;CHR$ 128;CHR$ 143 4 IF x<22 THEN PRINT FLASH 1;AT x,0;CHR$ 143;AT x+1,0;CHR$ 128;AT 20-x,31;CHR$ 128;AT 20-x+1,31;CHR$ 143 5 NEXT x 10 RANDOMIZE : PAPER 0: INK 7 20 INPUT "How Many Lines (1-10)? ";q: IF q>10 THEN GO TO 20 30 FOR g=1 TO q 40 DIM s(44) 50 FOR n=1 TO 6 60 LET a=1+INT (RND*44) 70 IF NOT s(a) THEN LET s(a)=a: GO TO 90 80 GO TO 60 90 NEXT n 100 PRINT AT g*2,5;"(";g;") "; 110 LET c=0 120 FOR n=1 TO 44 130 IF s(n) THEN LET c=c+1: PRINT s(n);"," AND c<6; 140 NEXT n 150 BEEP .01,20: PRINT '' 160 NEXT g: PRINT #1;AT 1,10;"Good Luck!!" 170 PAUSE 0: STOP ```