void outputBoard(); void init(char[numRows][numCols]); bool allUnprintable(string s); void setEqual(char[numRows][numCols], char[numRows][numCols]); bool impasse(char[boardHeight][boardWidth]); void solve(int); class Trans { public: char pattern[numRows][numCols]; char id; Trans(); Trans(char[numRows][numCols]); bool place(int, int); void clear(); }; Trans::Trans() { - default constructor, so do nothing } Trans::Trans(char cc[numRows][numCols]) { - copy the contents of cc to pattern } bool Trans::place(int r, int c) { - place pattern on the board in the given location } void Trans::clear() { - clear out the invoking pattern on the board } class Piece { public: Trans *patterns[numTrans]; int count; Piece(); Piece(char[numRows][numCols]); void transpose(char[numRows][numCols]); void rotate90(char[numRows][numCols]); }; Piece::Piece() { - default constructor, so do nothing } Piece::Piece(char cc[numRows][numCols]) { - acquire all orientations and store them in patterns } void Piece::transpose(char cc[numRows][numCols]) { - transpose cc, and cc contains the new pattern } void Piece::rotate90(char cc[numRows][numCols]) { - rotate cc by 90 degrees counterclockwise, and cc contains the new pattern } int main(int argc, char **argv) { - quit if no input file is given in the command line - quit if the input file is invalid - acquire the pieces from the input file and store them in appropriate places - declare and initialize a two-dimensional array that symbolizes the board - solve the puzzle and outputs solutions } void outputBoard() { - display the board } void init(char cc[numRows][numCols]) { - initialize cc by making every element in the array a space } bool allUnprintable(string s) { - return true if s doesn't contain '#'; return false otherwise } void setEqual(char cc[numRows][numCols], char cc2[numRows][numCols]) { - set the contents of cc equal to those of cc2 } bool impasse(char b[boardHeight][boardWidth]) { - detect various board layouts that definitely lead nowhere to speed up the process of finding the solution } void solve(int n) { - try all arrangements of the pieces recursively }Let's look at the next step!◀ Exercise #6: Solving Draught Puzzle▶ Solving Draught Puzzle - Step 2