Skip to content

Commit 5b6ad96

Browse files
committed
fix: math symbol problem
1 parent c984ac0 commit 5b6ad96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ public static void startGame() {
1111
for (int i = 0; i < Engine.ROUNDS; i++) {
1212
int num1 = Utils.generateNumber(0, 100);
1313
int num2 = Utils.generateNumber(0, 100);
14+
char mathSymbol = getRandomMathSymbol();
1415

15-
String question = num1 + " " + getRandomMathSymbol() + " " + num2;
16+
String question = num1 + " " + mathSymbol + " " + num2;
1617

17-
int result = switch (getRandomMathSymbol()) {
18+
int result = switch (mathSymbol) {
1819
case '+' -> num1 + num2;
1920
case '-' -> num1 - num2;
2021
case '*' -> num1 * num2;

0 commit comments

Comments
 (0)