Can anyone help? I am trying to create a game that has the same basic rules as the board game SORRY. I keep getting stuck in an infinite loop as well as a few other problems. Any suggestions?
A quick glance shows that line 43-47 will loop. Notice where the braces are. Also may help to indent your code properly to see where the loops actually are.
Line 9 srand (time(NULL)); // only once. . No this line will be executed each time the function is called. Line 8 is better placed at line 24 so that it is only done once when the program starts.
I think you want to put lines 49 - 155 inside the while loop.