aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrolyxon <krolyxon@tutanota.com>2023-09-01 11:47:52 +0530
committerkrolyxon <krolyxon@tutanota.com>2023-09-01 11:47:52 +0530
commit66e624a44db7992da3a7da36c0eda24c46828815 (patch)
tree082017f30733c99455cac70facf7eda3e9205a5f
parent5103602021d84dfca498e9e0ad135814fe430717 (diff)
make some variables static
-rw-r--r--src/main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 86e9db6..2de0f4c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,10 +5,10 @@
#include <time.h>
// https://texteditor.com/multiline-text-art/
-const int EASY_SCORE_DECREMENT = 10;
-const int MEDIUM_SCORE_DECREMENT = 20;
-const int LOWER = 1;
-const int UPPER = 4;
+static const int EASY_SCORE_DECREMENT = 10;
+static const int MEDIUM_SCORE_DECREMENT = 20;
+static const int LOWER = 1;
+static const int UPPER = 4;
typedef enum Difficulty {
Easy,
@@ -18,9 +18,9 @@ typedef enum Difficulty {
int list[35];
-int score = 100;
-int level = 1;
-int size = 5;
+static int score = 0;
+static int level = 1;
+static int size = 5;
// Declaring Functions
void decrement_score(Difficulty diff);
@@ -120,6 +120,9 @@ Difficulty get_difficulty() {
case 3:
difficulty = Hard;
break;
+ default:
+ printf(COLOR_RED "Invalid Choice. Defaulting to Medium\n" COLOR_OFF);
+ break;
}
return difficulty;
}