Skip to content

Commit b559859

Browse files
committed
upd: linter bug fix
1 parent f9d7f14 commit b559859

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public static void userGreetings() {
1616
}
1717

1818
public static void selectGame() {
19-
String[] gamesList = {"1 - Greet", "2 - Even", "3 - Calc", "4 - GCD",
20-
"5 - Progression", "6 - Prime", "0 - Exit"};
19+
String[] gamesList = {"1 - Greet", "2 - Even", "3 - Calc", "4 - GCD", "5 - Progression", "6 - Prime", "0 - Exit"};
2120
Scanner sc = new Scanner(System.in);
2221
String formattedGamesList = Arrays.toString(gamesList)
2322
.replace("[", "")
@@ -28,7 +27,7 @@ public static void selectGame() {
2827
System.out.println(formattedGamesList);
2928
int gameNumber = sc.nextInt();
3029
switch (gameNumber) {
31-
case 0-> System.console();
30+
case 0 -> System.console();
3231
case 1 -> Cli.userGreeting();
3332
case 2 -> EvenGame.gameLogic();
3433
case 3 -> Calc.gameLogic();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
public class EvenGame {
66
public static void gameLogic() {
7+
final int rndMax = 100;
78
Scanner sc = new Scanner(System.in);
89
Engine.userGreetings();
910
System.out.println("Answer 'yes' if the number is even, otherwise answer 'no'.");
1011
while (Engine.questionCounter != Engine.MAX_QUESTIONS) {
1112
Random rand = new Random();
12-
int randNum = rand.nextInt(100);
13+
int randNum = rand.nextInt(rndMax);
1314
System.out.println("Question: " + randNum);
1415
System.out.print("Your answer: ");
1516
String answer = sc.next();

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55

66
public class Progression {
77
public static void gameLogic() {
8-
final int ARR_LENGTH = 10;
9-
final int STEP_MAX = 10;
10-
final int HIDE_ELEMENT_MAX = 9;
11-
final int FIRST_NUM_MAX = 100;
8+
final int arrLength = 10;
9+
final int stepMax = 10;
10+
final int hideElementMax = 9;
11+
final int firstNumMax = 100;
1212
Scanner sc = new Scanner(System.in);
13-
int[] progression = new int[ARR_LENGTH];
13+
int[] progression = new int[arrLength];
1414
Random randNum = new Random();
1515

1616
Engine.userGreetings();
1717
System.out.println("What number is missing in the progression?");
1818
while (Engine.questionCounter != Engine.MAX_QUESTIONS) {
19-
int progressionStep = randNum.nextInt(1, STEP_MAX);
20-
int randHideElement = randNum.nextInt(0, HIDE_ELEMENT_MAX);
21-
int firstNum = randNum.nextInt(1, FIRST_NUM_MAX);
19+
int progressionStep = randNum.nextInt(1, stepMax);
20+
int randHideElement = randNum.nextInt(0, hideElementMax);
21+
int firstNum = randNum.nextInt(1, firstNumMax);
2222
progression[0] = firstNum;
2323
for (int i = 1; i < progression.length; i++) {
2424
progression[i] = progression[i - 1] + progressionStep;

0 commit comments

Comments
 (0)