Ice: use something like this.. {variable = rand() % max;} It'll give you a random number between 0 & "max"(which should also be replaced). I don't really know much about how it works, since I don't actually program in C++ :-D
_________________________
Those who say do not know. Those who know do not say.
rand() produces a random integer value. % is called the modulus operator. It's basically what you learned to be the remainder in division. Ie. 5 % 3 = 2 and 16 % 5 = 1 As for this function, it actually only returns a number from 0 to max - 1, as you can't divide a number by a number and have the remainder equal to the divisor. Ie. a % b cannot equal b.