void solver(int grid[9][9], int x, int orig[9][9], int *check) { int i; int col; int row; col = x % 9; row = x / 9; if (grid[col][row] != 0 && (row != 8 || col != 8) && *check < 2) solver(grid, x + 1, orig, check); i = 1; while (i < 10 && *check < 2) { if (row != 8 || col != 8) { if (pos_checker(grid, row, col, i) && grid[col][row] == 0) { position(&grid[col][row], &orig[col][row], i, *check); solver(grid, x + 1, orig, check); grid[col][row] = 0; } } else last_number(orig, i, check); i++; } }
//------------------------------------------------------------------------ double path_tokenizer::next(char cmd) { if(!next()) throw exception("parse_path: Unexpected end of path"); if(last_command() != cmd) { char buf[100]; sprintf(buf, "parse_path: Command %c: bad or missing parameters", cmd); throw exception(buf); } return last_number(); }