Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

rand

Name: Anonymous 2009-10-27 11:51

How do I get a random number between nMin and nMax?
I tried using:
   srand(time(0));
   int x = rand() % nMax + nMin;
...

I will use this to randomize the starting point of particles in a particle system.

Name: Anonymous 2009-10-27 13:23

I just make a appropriately-sized cardboard die and throw it.
If you're short on time, you can keep throwing Xd10 until you get a number in range (flip a coin to determine sign).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List