(Note that PlayGame() isn't finished)
When I run this code, and enter the sequence "1" followed by "1" (New Game > Play This Map?), it says "Ancient Warfare.exe has stopped working" and I get the error in the compiler "Process terminated with status -1073741510 (0 minutes, 12 seconds)" (time varies, of course). Does anyone know what I'm doing wrong?
This one was trickey but it appears to be a scope issue when you return from your "CreateGame()" function. Declaring 'iHiddenTable[14][14]' on line 105 to be static should fix the crash.
The loops in CreateGameBoard() are going out of bounds, treating cTable and iHiddenTable as arrays of 15x15 elements when they are actually 14x14. It would be alot cleaner if you use constants to define the board size. E.g.,
1 2 3 4 5 6 7 8
#include <iostream>
#define BoardWidth 15
#define BoardHeight 15
...
int iHiddenTable[BoardWidth][BoardHeight];
for (int y = 0; y < BoardHeight; y++)
for (int x = 0; x < BoardWidth; x++)
Also, cTable should probably be type unsigned char. If you move to a compiler where char is signed by default then you will have truncation problems, particularly with this line: