|
@ -215,6 +215,21 @@ void generateSudoku(int grid[SIZE][SIZE], int difficulty, int level) { |
|
|
|
|
|
|
|
|
void turnFunction(int grid[SIZE][SIZE]) { |
|
|
void turnFunction(int grid[SIZE][SIZE]) { |
|
|
printf("\nTurn function - Choose an action:\n"); |
|
|
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"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|