Browse Source

Commit 25 code

remotes/origin/Lucas
Lucas Heil 11 months ago
parent
commit
2318c9e395
  1. 19
      src/main/c/sudoku.c

19
src/main/c/sudoku.c

@ -468,7 +468,24 @@ void inputFunction(int grid[SIZE][SIZE]) {
switch (action) { switch (action) {
case 1: case 1:
printf("Case 1 \n");
printf("Enter the coordinates (row and column) separated by space:\n");
int row_e, col_e, num;
while (true){
char rowe_str[10];
char cole_str[10];
scanf("%s %s", rowe_str, cole_str);
row_e = rowe_str[0] - '0'; // Convert the first character to an integer
col_e = cole_str[0] - '0'; // Convert the first character to an integer
if (((row_e >= 1 && row_e <= 9) && rowe_str[1] == '\0') && ((col_e >= 1 && col_e <= 9) && cole_str[1] == '\0')) {
break;
} else {
printf("Invalid input. Please enter a number between 1 and 9.\n");
}
}
break; break;
case 2: case 2:

Loading…
Cancel
Save