From 58bc8c183a88a21a0187e4584e51e4043d19cbcb Mon Sep 17 00:00:00 2001 From: Lucas Heil Date: Wed, 7 Feb 2024 17:35:18 +0100 Subject: [PATCH] refactoring: 10 --- src/main/c/sudoku.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/c/sudoku.c b/src/main/c/sudoku.c index 1b134a1..975a080 100644 --- a/src/main/c/sudoku.c +++ b/src/main/c/sudoku.c @@ -3,6 +3,7 @@ #include #include + #define SIZE_OF_GAMEBORD_AXIS_X 9 #define SIZE_OF_GAMEBORD_AXIS_Y 9 #define EMPTY 0 @@ -15,7 +16,7 @@ int selected_level; void Game_loop(); //is instead of main void Level_Pool(int difficulty); -void selectLevel(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y]); +void Level_Selection(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y]); void initializeGrid(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y]); void create_playing_field(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y], int difficulty, int level); void Player_actions_for_playing(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y]); @@ -242,7 +243,7 @@ void Game_loop() { if ((difficulty >= 1 && difficulty <= 3) && input[1] == '\0') { Level_Pool(difficulty); - selectLevel(grid); + Level_Selection(grid); Player_actions_for_playing(grid); } else { printf("Invalid input. Please enter a number between 1 and 3.\n"); @@ -260,7 +261,7 @@ void Level_Pool(int difficulty) { -void selectLevel(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y]) { +void Level_Selection(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBORD_AXIS_Y]) { int level = 0; printf("\nSelect a level:\n"); while (true){ @@ -350,7 +351,7 @@ void Player_actions_for_playing(int grid[SIZE_OF_GAMEBORD_AXIS_X][SIZE_OF_GAMEBO check_if_Sudoku_solved(grid); break; case 5: - selectLevel(grid); + Level_Selection(grid); break; case 6: printf("Exiting Sudoku program.\n");