quote:
Originally posted by KeyStorm
randInt = ( rand() % 10 ) + 1;
or similar
Actually, since the low order bits are usually less random (using rand()) then the higher order bits, this would be more random:
randInt = (int)( rand() / (RAND_MAX + 1) * 10 + 1 )
the method previously posted uses only the lowest few bits (the least random), while this method relies mostly on the high order bits.
Yes, it's picky