I do not have any idea how to make a random number generator, and I need one for what I am making. I need something that basically says, "make random number between 1 and 4."
I could use the help. Thank you Dream in Code!!
Random number generator.
Page 1 of 13 Replies - 22503 Views - Last Post: 17 January 2010 - 09:36 AM
Replies To: Random number generator.
#2
Re: Random number generator.
Posted 16 January 2010 - 03:54 PM
0FreakFire0, on 16 Jan, 2010 - 02:41 PM, said:
I do not have any idea how to make a random number generator, and I need one for what I am making. I need something that basically says, "make random number between 1 and 4."
I could use the help. Thank you Dream in Code!!
I could use the help. Thank you Dream in Code!!
the Random class
http://msdn.microsof...tem.random.aspx
#3
Re: Random number generator.
Posted 17 January 2010 - 08:10 AM
Hey, guess what?? I did some researching and found out how to do so!!
The "* 4" says how many numbers it will go by. The output of that will either be 0, 1, 2, or 3; four different numbers. You can change the 4 to anything. There is your random number generator!! Thanks for your attempted help/response!!
Randomize() Number = Int(Rnd() * 4)
The "* 4" says how many numbers it will go by. The output of that will either be 0, 1, 2, or 3; four different numbers. You can change the 4 to anything. There is your random number generator!! Thanks for your attempted help/response!!
#4
Re: Random number generator.
Posted 17 January 2010 - 09:36 AM
simply
Dim rn As New Random n =rn.Next(1, 4)
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|