PDA

View Full Version : Random Number



OneHitWonder
01-07-2010, 23:15
Good evening,

I have read around the forums and the manual about randomizing a number. Then RND command doesn't actually randomize a number, I have searched because couldn't find anything on "seeding" RND.

How can I do this or point be somewhere in the manual I could learn this thanks.

EDITED

Apologies for this post as I obviously didn't look hard enough and fount the answer I was looking for: Randomize :oops:


OneHitWonder

Lionheart008
01-07-2010, 23:45
try this :)


Uses "console"

Randomize Timer

PrintL "random number: " + random1
WaitKey


Function TBMain() As Long

MsgBox 0, "random number: " + random1
End Function

Function random1() As Long
Local x As Long
Static last As Long

Do
x = Rnd(1,100)
Loop While x = last
last = x

Function = x
End Function

bye, frank