I\'m taking a C refresher and took on a board game as an exercise. The board game is \"Game of the Generals\" and is pretty much like chess as it uses pieces with ranks on a
Make sure to initialize / seed the random number generator:
#include <time.h>
srand(time(NULL));
If you don't seed the pseudo random number generator, it is like if you called in the start of your program:
srand(1);
You can call srand
with an argument that depends on the time so that two successive calls
of your program would generate different numbers:
srand(time(NULL));