random()
#7

A way to think of random() is that the 'max' paramater you input is the amount of possible values returned. For example:


INPUT
POSSIBLE OUTPUTS


1
0


2
0, 1


3
0, 1, 2


4
0, 1, 2, 3



Notice how the input value is the amount of possible outputs, so using that you can figure out that a 'max' of 10 will give you 10 possible outputs, and because they can not be negative and start at 0, they must be 0 through to 9.

Hope it helps

~Cueball~
Reply


Messages In This Thread
random() - by Kinetic - 25.02.2009, 02:25
Re: random() - by JaYmE - 25.02.2009, 02:31
Re: random() - by Kinetic - 25.02.2009, 02:49
Re: random() - by yom - 25.02.2009, 03:06
Re: random() - by JaYmE - 25.02.2009, 03:11
Re: random() - by Kinetic - 25.02.2009, 04:03
Re: random() - by Cueball - 25.02.2009, 06:26
Re: random() - by mamorunl - 25.02.2009, 08:47

Forum Jump:


Users browsing this thread: 1 Guest(s)