Browse Source

Commit 15 code

remotes/origin/Lucas
Lucas Heil 11 months ago
parent
commit
6f35efdf81
  1. 16
      src/main/c/sudoku.c

16
src/main/c/sudoku.c

@ -260,6 +260,22 @@ void turnFunction(int grid[SIZE][SIZE]) {
void tipFunction(int grid[SIZE][SIZE]) {
printf("\nTip function - Choose an option:\n");
int option = 0;
while (true){
char tip_str[10];
scanf("%s", tip_str);
option = tip_str[0] - '0'; // Convert the first character to an integer
if ((option >= 1 && option <= 3) && tip_str[1] == '\0') {
break;
} else {
printf("Invalid input. Please enter a number between 1 and 3.\n");
}
}
}

Loading…
Cancel
Save