PDA

Click to See Complete Forum and Search --> : random numbers


HarryW
Dec 12th, 2000, 12:58 AM
The Rnd function will return a random number between 0 and 1. If you want an integer between say 1 and 10 inclusive then you would do this:


RandomNum = Int(Rnd * 10) + 1


So for your list, it depends on how you are storing your list. If you have it in an array then just use a random array index, like this:


RandomWord = WordsArray(RandomIndex)

HarryW
Dec 12th, 2000, 12:59 AM
Oh yes and at the start of your program you should add this line:


Randomize Timer


To seed the random function with a starting value, taken form the system timer.

Pkirsten2001
Dec 13th, 2000, 05:44 PM
randomize timer
wordnumber = int(rnd * x)+1
if wordnumber = ____ then word = ____


If u understand this it should work.