|
|
@ -15,6 +15,9 @@ int selected_level; |
|
|
|
void startSudoku(); //is instead of main |
|
|
|
void availableLevelsFunction(int difficulty); |
|
|
|
void selectLevel(int grid[SIZE][SIZE]); |
|
|
|
void initializeGrid(int grid[SIZE][SIZE]); |
|
|
|
void generateSudoku(int grid[SIZE][SIZE], int difficulty, int level); |
|
|
|
|
|
|
|
|
|
|
|
void startSudoku() { |
|
|
|
int grid[SIZE][SIZE]; |
|
|
@ -64,7 +67,11 @@ void selectLevel(int grid[SIZE][SIZE]) { |
|
|
|
level = level_select[0] - '0'; // Convert the first character to an integer |
|
|
|
|
|
|
|
if ((level >= 1 && level <= 3) && level_select[1] == '\0') { |
|
|
|
printf("Input is correct"); |
|
|
|
selected_level = level; |
|
|
|
|
|
|
|
level--; // Adjust to 0-based index |
|
|
|
|
|
|
|
generateSudoku(grid, difficulty, selected_level); |
|
|
|
break; |
|
|
|
} else { |
|
|
|
printf("Invalid input. Please enter a number between 1 and 3.\n"); |
|
|
@ -75,6 +82,24 @@ void selectLevel(int grid[SIZE][SIZE]) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void initializeGrid(int grid[SIZE][SIZE]) { |
|
|
|
for (int i = 0; i < SIZE; i++) { |
|
|
|
for (int j = 0; j < SIZE; j++) { |
|
|
|
grid[i][j] = EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void generateSudoku(int grid[SIZE][SIZE], int difficulty, int level) { |
|
|
|
initializeGrid(grid); |
|
|
|
printf("Level is getting initialized"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|