Re: dice game of pig
It's because you didn't specify what will happen after "1" is rolled.
You just carry on with the loop.
Try putting break or something in the if keyword when "1" is rolled.
Oh and BTW if you want different values every time you run a program, use:
srand(time(0)); this will randomize the rand() seed, based on the timer.
rand(); is made to get the same values everytime because it's easier to debug.
Last edited by Odiee; October 29th, 2008 at 03:33 AM.
You just divided by zero, didn't you?