Browse Source

refactoring: 5

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

8
src/main/c/sudoku.c

@ -24,7 +24,7 @@ void selectLevel(int grid[SIZE][SIZE]);
void initializeGrid(int grid[SIZE][SIZE]); void initializeGrid(int grid[SIZE][SIZE]);
void create_playing_field(int grid[SIZE][SIZE], int difficulty, int level); void create_playing_field(int grid[SIZE][SIZE], int difficulty, int level);
void Player_actions_for_playing(int grid[SIZE][SIZE]); void Player_actions_for_playing(int grid[SIZE][SIZE]);
void tipFunction(int grid[SIZE][SIZE]);
void giving_hints_to_player(int grid[SIZE][SIZE]);
void inputFunction(int grid[SIZE][SIZE]); void inputFunction(int grid[SIZE][SIZE]);
void printGrid(int grid[SIZE][SIZE]); void printGrid(int grid[SIZE][SIZE]);
void doneFunction(int grid[SIZE][SIZE]); void doneFunction(int grid[SIZE][SIZE]);
@ -319,7 +319,7 @@ void create_playing_field(int grid[SIZE][SIZE], int difficulty, int level) {
void Player_actions_for_playing(int grid[SIZE][SIZE]) { void Player_actions_for_playing(int grid[SIZE][SIZE]) {
while (1) { while (1) {
printf("\nTurn function - Choose an action:\n"); printf("\nTurn function - Choose an action:\n");
printf("1. Tip function\n");
printf("1. Hints\n");
printf("2. Input function\n"); printf("2. Input function\n");
printf("3. Print Sudoku grid\n"); printf("3. Print Sudoku grid\n");
printf("4. Done function\n"); printf("4. Done function\n");
@ -343,7 +343,7 @@ void Player_actions_for_playing(int grid[SIZE][SIZE]) {
switch (action) { switch (action) {
case 1: case 1:
tipFunction(grid);
giving_hints_to_player(grid);
break; break;
case 2: case 2:
inputFunction(grid); inputFunction(grid);
@ -368,7 +368,7 @@ void Player_actions_for_playing(int grid[SIZE][SIZE]) {
void tipFunction(int grid[SIZE][SIZE]) {
void giving_hints_to_player(int grid[SIZE][SIZE]) {
printf("\nTip function - Choose an option:\n"); printf("\nTip function - Choose an option:\n");
printf("1. Set the user-specified cell to the right value\n"); printf("1. Set the user-specified cell to the right value\n");
printf("2. Set the user-specified 3x3 field to the right values\n"); printf("2. Set the user-specified 3x3 field to the right values\n");

Loading…
Cancel
Save