Skip to content

Commit 65c0e5a

Browse files
committed
upd: linter bug fix
1 parent 366260c commit 65c0e5a

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

app/src/main/java/hexlet/code/Engine.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ public class Engine {
77
private static String userName = "";
88
private static int questionCounter = 0;
99
private static final int MAX_QUESTIONS = 3;
10+
private static final int STAT_GREET = 0;
11+
private static final int STAT_EVEN = 1;
12+
private static final int STAT_CALC = 2;
13+
private static final int STAT_GCD = 3;
14+
private static final int STAT_PROGRESSION= 4;
15+
private static final int STAT_PRIME = 5;
16+
private static final int STAT_EXIT = 6;
1017

1118
public static void userGreetings() {
1219
Scanner sc = new Scanner(System.in);
@@ -16,7 +23,8 @@ public static void userGreetings() {
1623
}
1724

1825
public static void selectGame() {
19-
String[] gamesList = {"1 - Greet", "2 - Even", "3 - Calc", "4 - GCD", "5 - Progression", "6 - Prime", "0 - Exit"};
26+
String[] gamesList = {"1 - Greet", "2 - Even", "3 - Calc", "4 - GCD",
27+
"5 - Progression", "6 - Prime", "0 - Exit"};
2028
Scanner sc = new Scanner(System.in);
2129
String formattedGamesList = Arrays.toString(gamesList)
2230
.replace("[", "")
@@ -27,13 +35,13 @@ public static void selectGame() {
2735
System.out.println(formattedGamesList);
2836
int gameNumber = sc.nextInt();
2937
switch (gameNumber) {
30-
case 0 -> System.console();
31-
case 1 -> Cli.userGreeting();
32-
case 2 -> EvenGame.gameLogic();
33-
case 3 -> Calc.gameLogic();
34-
case 4 -> GCD.gameLogic();
35-
case 5 -> Progression.gameLogic();
36-
case 6 -> Prime.gameLogic();
38+
case STAT_GREET -> System.console();
39+
case STAT_EVEN -> Cli.userGreeting();
40+
case STAT_CALC -> EvenGame.gameLogic();
41+
case STAT_GCD -> Calc.gameLogic();
42+
case STAT_PROGRESSION -> GCD.gameLogic();
43+
case STAT_PRIME -> Progression.gameLogic();
44+
case STAT_EXIT -> Prime.gameLogic();
3745
default -> System.console();
3846
}
3947
}
@@ -46,7 +54,7 @@ public static int gcdGenerate(int a, int b) {
4654
}
4755
return a;
4856
}
49-
public static String getUserName(){
57+
public static String getUserName() {
5058
return userName;
5159
}
5260
public static int getMaxQuestions() {

0 commit comments

Comments
 (0)