|
@ -26,6 +26,7 @@ void generateSudoku(int grid[SIZE][SIZE], int difficulty, int level); |
|
|
void turnFunction(int grid[SIZE][SIZE]); |
|
|
void turnFunction(int grid[SIZE][SIZE]); |
|
|
void tipFunction(int grid[SIZE][SIZE]); |
|
|
void tipFunction(int grid[SIZE][SIZE]); |
|
|
void inputFunction(int grid[SIZE][SIZE]); |
|
|
void inputFunction(int grid[SIZE][SIZE]); |
|
|
|
|
|
void printGrid(int grid[SIZE][SIZE]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int availableLevels[3][3][SIZE][SIZE] = { |
|
|
int availableLevels[3][3][SIZE][SIZE] = { |
|
@ -317,6 +318,7 @@ void turnFunction(int grid[SIZE][SIZE]) { |
|
|
printf("\nTurn function - Choose an action:\n"); |
|
|
printf("\nTurn function - Choose an action:\n"); |
|
|
printf("1. Tip function\n"); |
|
|
printf("1. Tip function\n"); |
|
|
printf("2. Input function\n"); |
|
|
printf("2. Input function\n"); |
|
|
|
|
|
printf("3. Print Sudoku grid\n"); |
|
|
|
|
|
|
|
|
int action; |
|
|
int action; |
|
|
|
|
|
|
|
@ -341,7 +343,7 @@ void turnFunction(int grid[SIZE][SIZE]) { |
|
|
inputFunction(grid); |
|
|
inputFunction(grid); |
|
|
break; |
|
|
break; |
|
|
case 3: |
|
|
case 3: |
|
|
printf("Case 3.\n"); |
|
|
|
|
|
|
|
|
printGrid(grid); |
|
|
break; |
|
|
break; |
|
|
case 4: |
|
|
case 4: |
|
|
printf("Case 4.\n"); |
|
|
printf("Case 4.\n"); |
|
@ -536,6 +538,16 @@ void inputFunction(int grid[SIZE][SIZE]) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void printGrid(int grid[SIZE][SIZE]) { |
|
|
|
|
|
printf("\nSudoku Grid:\n"); |
|
|
|
|
|
for (int i = 0; i < SIZE; i++) { |
|
|
|
|
|
for (int j = 0; j < SIZE; j++) { |
|
|
|
|
|
printf("%d ", grid[i][j]); |
|
|
|
|
|
} |
|
|
|
|
|
printf("\n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(){ |
|
|
int main(){ |
|
|
startSudoku(); |
|
|
startSudoku(); |
|
|