a math game for some kids
Posted on 2004-04-15
I am trying to write a math program for some kids I work with who are visually impaired and just need a little advice on a couple issues. For one, I'm writing the program in C, and I'm trying to generate random numbers for the problems which are asked. I seeded the generator with srand((unsigned)time(NULL)) at the beginning and am trying to exclude 0 from being generated as a possible number for a problem. For example: firstint = rand()%maxint. Maxint is defined according to how far the player has progressed in the game. I want the generated number to be between 1 and maxint. Any suggestions? Thanks a lot in advance.