Sun  Mon  Tue  Wed  Thu  Fri  Sat 

1  2  3  4  
5  6  7  8  9  10  11 
12  13  14  15  16  17  18 
19  20  21  22  23  24  25 
26  27  28  29  30  31 
Calendar
Upcoming eventsCookbook 
Random Number RangesHow do I get a random number somewhere between 5 and +5? Solution:
Random x only works for positive numbers and starts at 1. To get a negative number, or a range of numbers that goes below 0, you need to subtract from your positive random number. In order to start your range of random numbers at a positive number greater than 1, you'll need to add to your random number. Next we want to find a random number in that range and either lift or lower the range by our lowest number.
Submitted by talaya on 6. March 2009  23:07

Login (optional)Navigation 