Just an idea:
randomize timer()
for n = 1 to 20
print RanFloat( 0.00, 0.99 )
next n
wait key
end
// only to 3 decimal places though
function RanFloat( lower as float, upper as float )
local out as float : out = (rnd(int((upper*1000.0)-(lower*1000.0)))*0.001)+lower
endfunction out
And with precision:
randomize timer()
for n = 1 to 20
print RanFloat( 0.00, 0.99, 4 )
next n
wait key
end
function RanFloat( lower as float, upper as float, precision as byte )
local power as float : power = 10^precision
local out as float : out = (rnd(int((upper*power)-(lower*power)))/power)+lower
endfunction out
A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.