REM A Powerball drawing program by Martin VandenHurk.
REM Which Steve finds
to be a very goofy way
to do Powerball numbers...
REM So this
is the modified version
, which doesn
't use GOTO, or obsolete PEEK and POKE commands.
'FOR l = 1 TO 59
'POKE 5000 + l, l
'NEXT
b$ = "11111111111111111111111111111111111111111111111111111111111" 'Steve addition of a 59 length string of all 1's.
'SLEEP 3 'Why a sleep statement here? If we're going to time program execution, we don't need it to slow things down
'FOR l = 1 TO 59 'For that much, why are we even bothering with these PRINT statements at all? The CLS below erases them from the screen too fast for us to even register them with our human eyesight...
' PRINT PEEK(5000 + l);
' PRINT l; 'Even if we do print our values to the screen, WTH do we need to PEEK the numbers from 1 to 59? We just put them in memory with POKE in perfect order. Why not just print them and be done with it?
'NEXT
'PRINT "Now drawing powerball numbers..."
'ct = 1
'here:
FOR ct
= 1 TO 6 ' We want 6 numbers , so a FOR loop makes sense here, rather than a GOTO label DO ' A simple DO loop, to get an unique X. If we draw the same number twice, simply redraw until it's not an used number 'IF PEEK(5000 + x) <> 0 THEN r(ct) = x: POKE 5000 + x, 0: GOTO there
'GOTO here
r
(ct
) = x:
MID$(b$
, x
, 1) = "0" ' Basically the same as the code after the THEN which I commented out above, but using a simple string rather than PEEK and POKE to check for used numbers.'there: ' All needlessly complicated GOTO labels and junk, which simply obfuscates the code. These were all commented out and removed by Steve
' ct = ct + 1
' IF ct = 6 THEN GOTO done ELSE GOTO here
' done:
'CLS ' No need for a CLS here, or else there's no need for the printing above, as it'll simply dash off the screen too quick to read.
PRINT "Here are your 5 Powerball numbers:" PRINT "The red Powerball number is:";
PRINT "time started : "; a$