Browse Source

Commit 28 code

main^2
Lucas Heil 11 months ago
committed by Peter Wiebe
parent
commit
9eaea92e27
  1. 14
      src/main/c/sudoku.c

14
src/main/c/sudoku.c

@ -26,6 +26,7 @@ void generateSudoku(int grid[SIZE][SIZE], int difficulty, int level);
void turnFunction(int grid[SIZE][SIZE]);
void tipFunction(int grid[SIZE][SIZE]);
void inputFunction(int grid[SIZE][SIZE]);
void printGrid(int grid[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("1. Tip function\n");
printf("2. Input function\n");
printf("3. Print Sudoku grid\n");
int action;
@ -341,7 +343,7 @@ void turnFunction(int grid[SIZE][SIZE]) {
inputFunction(grid);
break;
case 3:
printf("Case 3.\n");
printGrid(grid);
break;
case 4:
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(){
startSudoku();

Loading…
Cancel
Save