![]() Unsigned int GAME_SOLUTION::GetSolution(int idx_x, int idx_y) * This method just sets a solution value */ Void GAME_SOLUTION::SetSolution(int num, int idx_x, int idx_y) * This clears a solution ready for the next game */įor(idx1=0 idx1solution = 0 * This method tests if there are two identical values in the same column */įor(idx=0 idxsolution = num)īool GAME_SOLUTION::TestSmallGrid(int num, int idx1, int idx2) ![]() * This method tests if there are two identical values in the same row */īool GAME_SOLUTION::TestColumn(int num, int idx_x) Ret2 += this->TestSmallGrid(num, (int)(idx1/3), (int)(idx0/3)) īool GAME_SOLUTION::TestRow(int num, int idx_y) Replaced by the one listed to be put down. * This tests to see if another number which has already been placed can be Ret = this->CorrectError(num1, idx2, idx1, ret) īool GAME_SOLUTION::CorrectError(int num, int idx_x, int idx_y, int ret) The same column, if there is, then another number is selected until 1 There is another number either in the smaller 3x3 grid, the same row or ![]() The way this method will work, is by going through the grid, 1 square atĪ time, and randomly selecting a number. * This method generates a solution which the user must then try and get.
0 Comments
Leave a Reply. |