diff --git a/src/main/c/sudoku.c b/src/main/c/sudoku.c new file mode 100644 index 0000000..8e7d480 --- /dev/null +++ b/src/main/c/sudoku.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +#define SIZE 9 +#define EMPTY 0 +#define LEVEL_NUMBER 3 + + +int difficulty; +int selected_level; + + +void startSudoku(); //is instead of main + +void startSudoku() { + int grid[SIZE][SIZE]; + selected_level = 0; + + while (1) { + printf("\nDifficulty Function - Choose difficulty:\n"); + printf("1. Easy\n2. Medium\n3. Hard\n"); + printf("Enter the corresponding number or type 'quit' to exit: "); + + char input[10]; + scanf("%s", input); + + if (strcmp(input, "quit") == 0) { + break; + } + + difficulty = input[0] - '0'; // Convert the first character to an integer + + if ((difficulty >= 1 && difficulty <= 3) && input[1] == '\0') { + printf("Input is correct"); + } else { + printf("Invalid input. Please enter a number between 1 and 3.\n"); + } + + } +} + +int main(){ + startSudoku(); + return 0; +} \ No newline at end of file