void PrintSolution(void) { int a, b; int Sodoku[16][16] = { }; for (a = 0; a < 16; a++) for (b = 0; b < 16; b++) Sodoku[a][b] = -1; for (a = 0; a < nResult; a++) Sodoku[retRw(Result[a])][retCl(Result[a])] = retNb(Result[a]); for (a = 0; a < 16; a++) { for (b = 0; b < 16; b++) { printf("%c", Sodoku[a][b] + 'A'); } printf("\n"); } }
void PrintSolution(void) { int a, b; int Sudoku[9][9] = {}; for (a = 0; a < 9; a++) { for (b = 0; b < 9; b++) Sudoku[a][b] = -1; } for (a = 0; a < nResult; a++) Sudoku[retRw(Result[a])][retCl(Result[a])] = retNb(Result[a]); for (a = 0; a < 9; a++) { for (b = 0; b < 9; b++) { if (Sudoku[a][b] >= 0) printf("%d ", Sudoku[a][b] + 1); else printf(". "); } printf("\n"); } }
inline int retRn(int N) { return retNb(N) * 9 + retRw(N); }
inline int retSq(int N) { return retRw(N) * 9 + retCl(N); }
inline int retBx(int N) { return ((retRw(N) / 3) * 3) + (retCl(N) / 3); }
inline int retBx(int N) { return ((retRw(N) / 4) * 4) + (retCl(N) / 4); }