Dim I
Dim A$[101]
Dim x$
Dim duplicate=false
Dim z$
Dim Y
Dim N

Print "Selecting 6 unique random numbers ..."
Print

Selection:

N=1
while N<7
duplicate=false
Randomize
Y = ((Rnd * 49)+1)
z$=Str$(INT(Y))


for I = 1 to N
if A$[I]=z$ Then
duplicate = true
Exit for
end if
Next  


if duplicate=false then
A$[N]=z$
Print A$[N]
N=N+1
end if

Wend

Print
Print "Another 6 numbers y/n ?"
Input x$ 

if x$="y" then
N=1
Goto Selection
end if

This code and the BCX Basic to C compiler was used to compile the random freeware executive. The BCX compiler is freeware and can be downloaded at:-

http://bcx.basicguru.com/

HOMEPAGE