Random number generator
I'm working on a DnD game and I need to know how to make a random number generator, say 1 to 50 for dice rolls and such. How would I do that?
Use srand() ONCE to seed it, then call rand() for a random int. You can then use the modulus operator to confine it to a certain range of values.
Topic archived. No new replies allowed.