Skip to content
Snippets Groups Projects
Commit be58ae1c authored by TheLostWanderer's avatar TheLostWanderer
Browse files

add sudoku6

parent cf6da182
No related branches found
No related tags found
No related merge requests found
...@@ -3,4 +3,6 @@ ...@@ -3,4 +3,6 @@
int allocateSudoku1(int sudoku[9][9]); int allocateSudoku1(int sudoku[9][9]);
int allocateSudoku6(int sudoku[]);
#endif #endif
...@@ -48,4 +48,41 @@ int allocateSudoku1(int sudoku[9][9]){ ...@@ -48,4 +48,41 @@ int allocateSudoku1(int sudoku[9][9]){
return 0; return 0;
} }
int allocateSudoku6(int sudoku[]){
char *sudokuChar[16] = {
{"00JEIA0000GONM00"},
{"G0PIBKJH0000FA0O"},
{"00F0D0EG0BP0L0KC"},
{"000HMO0LFKEAPG0J"},
{"BPGK0DFJ00NIA00H"},
{"EM0COBIPA0HF0DN0"},
{"DIH000NEKGCPJ0MF"},
{"FN000MG0000LIE0P"},
{"0JM0NEKD00LCH000"},
{"ID0G00MAJP0N00BL"},
{"LAC00GOIB00000JD"},
{"P0KNLJ00EF0D0OAG"},
{"AF0LK0HBDO000IGM"},
{"0E0DJI00PCFGOKL0"},
{"00OPECD0LIM00FH0"},
{"KC0M0F00NH000JPE"}
};
for (int i=0; i< 16; i++){
char *line = sudokuChar[i];
for (int j=0; j<16; j++){
char cell = *(line + j);
if ( (int) cell == 48 ){
sudoku[i*16 + j] = 0;
}
else {
sudoku[i*16 + j] = (int) cell - 64;
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment