const int numPieces = 13; const int numTrans = 8; const int numRows = 5; const int numCols = 5; const int boardWidth = 10; const int boardHeight = 10; clock_t start = clock(); char board[boardHeight][boardWidth]; char tempcc[numRows][numCols]; ifstream fin;I make the attributes of the board and the pieces constants because their values shouldn’t change throughout the program. In refining the skeleton, I realize that in order to not store repeated orientations, I need to be able to see if a particular orientation is already stored.
struct array { char acc[numRows][numCols]; };And I created the following functions:
bool sameArray(array a, char cc[numRows][numCols]) { - return true if the contents of a are identical to cc; return false otherwise } bool repeated(vector<array> va, char cc[numRows][numCols]) { - return true if cc exists in va; return false otherwise } void arrayInit(array & ar, char cc[numRows][numCols]) { - make the contents of ar equal to cc }Let's look at the next step!◀ Solving Draught Puzzle - Step 1▶ Solving Draught Puzzle - Step 3