Browse Source

refactoring: 7

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

8
src/main/c/sudoku.c

@ -27,7 +27,7 @@ void Player_actions_for_playing(int grid[SIZE][SIZE]);
void giving_hints_to_player(int grid[SIZE][SIZE]); void giving_hints_to_player(int grid[SIZE][SIZE]);
void write_userinput_into_Sudoku(int grid[SIZE][SIZE]); void write_userinput_into_Sudoku(int grid[SIZE][SIZE]);
void printGrid(int grid[SIZE][SIZE]); void printGrid(int grid[SIZE][SIZE]);
void doneFunction(int grid[SIZE][SIZE]);
void check_if_Sudoku_solved(int grid[SIZE][SIZE]);
@ -322,7 +322,7 @@ void Player_actions_for_playing(int grid[SIZE][SIZE]) {
printf("1. Hints\n"); printf("1. Hints\n");
printf("2. Insert Number into Game\n"); printf("2. Insert Number into Game\n");
printf("3. Print Sudoku grid\n"); printf("3. Print Sudoku grid\n");
printf("4. Done function\n");
printf("4. Check if your Solution is correct\n");
printf("5. Select level\n"); printf("5. Select level\n");
printf("6. Quit\n"); printf("6. Quit\n");
@ -352,7 +352,7 @@ void Player_actions_for_playing(int grid[SIZE][SIZE]) {
printGrid(grid); printGrid(grid);
break; break;
case 4: case 4:
doneFunction(grid);
check_if_Sudoku_solved(grid);
break; break;
case 5: case 5:
selectLevel(grid); selectLevel(grid);
@ -556,7 +556,7 @@ void printGrid(int grid[SIZE][SIZE]) {
} }
} }
void doneFunction(int grid[SIZE][SIZE]) {
void check_if_Sudoku_solved(int grid[SIZE][SIZE]) {
printf("\nDone function - Checking if the solution is correct...\n"); printf("\nDone function - Checking if the solution is correct...\n");
for (int i = 0; i < SIZE; i++) { for (int i = 0; i < SIZE; i++) {

Loading…
Cancel
Save