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 12:35

OP here, thanks I got it now
I did rand(nMax-nMin)+nMin;
I still have a little problem, though.
Sometimes a couple or more particles start from the same position and they look like worms.

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