Mike’s Notebook: LOTTO

Authors

Publication

Pub Details

Date

Pages

See all articles from The Plotter v8 n9

My friends often encourage me to put my powerful TS2068 ROM to work for a good cause. What better way than to win the state lottery.

Now, I know that lotto number generators are ubiquitous but this one really works (fast). It can be modified for your geographical requirements. All you need to know is the range of numbers possible and the maximum number of picks per game.

In my state, the player specifies six (6) numbers ranging from 1 to 44. To change game parameters, type in the following program and make the following changes:

  • The range of numbers (1 to 44) are specified in lines 40, 60, and 120.
  • The number of picks (6) are found in lines 50 and 130.
  • Line 20 asks how many lines you would like to choose.

Just follow the prompt and you will be presented with one to ten extremely lucky numbers.

GOOD LUCK!!!

You may forward me 10% of all your earnings and be assured that you are contributing to a good cause.

Reprints:

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