Krolyxon
Commit 66e624a

Branches

Refs →

tros66e624a

make some variables static

Author
krolyxon
Date
2023-09-01 11:47 +0530
Parent
5103602
Commit
66e624a44db7992da3a7da36c0eda24c46828815

+10 −7

1 file changed

  1. M src/main.c +10 −7
M src/main.c View
@@ -5,10 +5,10 @@
55 #include <time.h>
66 // https://texteditor.com/multiline-text-art/
77
8−const int EASY_SCORE_DECREMENT = 10;
9−const int MEDIUM_SCORE_DECREMENT = 20;
10−const int LOWER = 1;
11−const int UPPER = 4;
8+static const int EASY_SCORE_DECREMENT = 10;
9+static const int MEDIUM_SCORE_DECREMENT = 20;
10+static const int LOWER = 1;
11+static const int UPPER = 4;
1212
1313 typedef enum Difficulty {
1414 Easy,
@@ -18,9 +18,9 @@ typedef enum Difficulty {
1818
1919 int list[35];
2020
21−int score = 100;
22−int level = 1;
23−int size = 5;
21+static int score = 0;
22+static int level = 1;
23+static int size = 5;
2424
2525 // Declaring Functions
2626 void decrement_score(Difficulty diff);
@@ -120,6 +120,9 @@ Difficulty get_difficulty() {
120120 case 3:
121121 difficulty = Hard;
122122 break;
123+ default:
124+ printf(COLOR_RED "Invalid Choice. Defaulting to Medium\n" COLOR_OFF);
125+ break;
123126 }
124127 return difficulty;
125128 }