REM IffySnuffy wants to pick from 5 numbers.
NUMBERS = 5
REM Define some constants to represent the status of a number.
AVAILABLE = 0
UNAVAILABLE = 1
REM Make an array to track their status (available/unavailable).
DIM Status(NUMBERS)
REM Ignoring the bottom (zeroth) member of the array.
REM All members of this array start out zero,
REM meaning: AVAILABLE for selection.
REM Set them to 1 (UNAVAILABLE) once picked.
REM The main loop. Count keeps track of the number of numbers that have been selected.
FOR Count = 1 TO NUMBERS
REM Using IffySnuffy's method,
REM keep picking random numbers between 1 and NUMBERS inclusive...
REPEAT
Pick% = RND(NUMBERS)
REM ...until you pick one that is available
UNTIL Status(Pick%) = AVAILABLE
REM Change that member of the array from 0 to 1,
REM to indicate that it's now unavailable.
Status(Pick%) = UNAVAILABLE
REM Press a key to continue and
REM print the selected number in IffySnuffy's format.
g = GET
PRINT TAB(1,Pick%) Pick%
REM A number has been selected, so loop again until Count reaches NUMBERS.
NEXT Count
REM All five numbers now picked, so finish...
PRINT TAB(1,NUMBERS + 2) "Finished."
END