I am having troubles getting this program to generate random numbers. Right now i have it set up to only generate 1 and 19. I do not know how to generate random numbers.
thank you if anyone can help my dumbass.
change
a = lowest+int(range*rand()/(RAND_MAX + 1.0)); to
a = (rand() % highest) + lowest;
This takes the random value, divides it by
highest and keeps the remainder (0-18) then adds 1 (0-19)
Now you're a smartass :mrgreen:
Reputation Points: 3281
Solved Threads: 895
Posting Sage
Offline 7,749 posts
since May 2006