Browse Source

Commit 11 code

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

15
src/main/c/sudoku.c

@ -215,6 +215,21 @@ void generateSudoku(int grid[SIZE][SIZE], int difficulty, int level) {
void turnFunction(int grid[SIZE][SIZE]) {
printf("\nTurn function - Choose an action:\n");
int action;
while (true){
char action_str[10];
scanf("%s", action_str);
action = action_str[0] - '0'; // Convert the first character to an integer
if ((action >= 1 && action <= 6) && action_str[1] == '\0') {
break;
} else {
printf("Invalid input. Please enter a number between 1 and 6.\n");
}
}
}

Loading…
Cancel
Save