Skip to content

Commit

Permalink
update Calc
Browse files Browse the repository at this point in the history
  • Loading branch information
Asterroth committed Nov 13, 2023
1 parent 3c350ee commit 6517759
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/hexlet/code/games/Calc.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public static void genGame() {
var num2 = Utils.getRandom(RANDOM_MIN, RANDOM_MAX);
var action = mathAction();
gameData[i][0] = num1 + " " + action + " " + num2;
gameData[i][1] = calcAction(num1, num2, action);
gameData[i][1] = calculate(num1, num2, action);
}
Engine.runGame(DESCRIPTION, gameData);
}
// Calculation of generated data
public static String calcAction(int num1, int num2, String action) {
public static String calculate(int num1, int num2, String action) {
var result = 0;
if (action.equals("+")) {
result = num1 + num2;
Expand Down

0 comments on commit 6517759

Please sign in to comment.