Skip to content

Commit 843504a

Browse files
committed
Engine refactor
1 parent bd5ae4e commit 843504a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class Engine {
77
private static String userName;
88
private static boolean defeated = false;
99
private static int round = 1;
10-
private static Random randomizer = new Random();
10+
private static final Random randomizer = new Random();
1111

1212
public static void greet(Scanner scanner) {
1313
System.out.println("Welcome to the Brain Games!");
@@ -37,10 +37,10 @@ public static void compareAnswers(String userAnswer, String correctAnswer) {
3737
public static void end(Scanner scanner) {
3838
if (defeated) {
3939
System.out.println("Let's try again, " + userName + "!");
40-
scanner.close();
4140
} else {
4241
System.out.println("Congratulations, " + userName + "!");
43-
scanner.close();
4442
}
43+
44+
scanner.close();
4545
}
4646
}

0 commit comments

Comments
 (0)