Posted By
|
Message
|
W3R3W00F Drum and Bass Fueled Psycho
Registered 08/11/2008
Points 374
|
28th December, 2010 at 05:42:57 -
Hey, TDC.
I'm just wondering how to generate a random number between 2 numbers (e.g. 200-250). I've tried following codes but I failed.
Thanks in advance!
An old and washed up once-kid
|
GamesterXIII
Registered 04/12/2008
Points 1110
|
28th December, 2010 at 05:48:56 -
random(51)+200
That will get you a number between 0 and 50 and add 200 to it
you can also reverse it
200+random(51)
n/a
|
Silveraura God's God
Registered 08/08/2002
Points 6747
|
28th December, 2010 at 05:49:11 -
Random(50) + 201 = Any number between 200 and 250.
When you generate a random number, it counts 0 as a number. So random 50 will give you any number between 0 and 49. Compensate for this by using 201 instead of 200.
Damn, beat me to it.
Edited by Silveraura
http://www.facebook.com/truediamondgame
|
W3R3W00F Drum and Bass Fueled Psycho
Registered 08/11/2008
Points 374
|
28th December, 2010 at 23:08:39 -
Ah, that's how it's done! Brilliant stuff.
Thanks, guys! Helped me a great deal.
An old and washed up once-kid
|
Mark McCauley
Registered 18/02/2009
Points 291
|
5th January, 2011 at 10:40:18 -
post removed
Edited by Mark McCauley
http://www.reddwarf.co.uk/forum/messages.cfm?threadid=44227736-C46F-AC56-02EBA05285818C14
|
|
|