From 66211d914aa4fd70c7f3df387f2243d0b23a38e0 Mon Sep 17 00:00:00 2001 From: egorskov Date: Sun, 20 Oct 2024 21:51:25 +0500 Subject: [PATCH] some changes --- src/Engine.php | 2 +- src/Games/Calc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Engine.php b/src/Engine.php index 804dda0..8b6371e 100644 --- a/src/Engine.php +++ b/src/Engine.php @@ -16,7 +16,7 @@ function communication(array $answers, string $game): void line("$game"); foreach ($answers as $key => $value) { $answer = prompt("Question: $key\nYou answer"); - if ($answer !== $value) { + if ($answer != $value) { line("'$answer' is wrong answer ;( Correct answer: '$value') \nLet's try again, $name!"); return; } else { diff --git a/src/Games/Calc.php b/src/Games/Calc.php index 0491255..c2f16cf 100644 --- a/src/Games/Calc.php +++ b/src/Games/Calc.php @@ -15,7 +15,7 @@ function runCalc(): void $game = 'What is the result of the expression?'; $answers = []; $signs = ['+', '-', '*']; - for ($i = 0; $i < ROUND; $i++) { + for ($i = 1; $i <= ROUND; $i++) { $first = mt_rand(MIN_NUM, MAX_NUM); $second = mt_rand(MIN_NUM, MAX_NUM); $operator = $signs[array_rand($signs)];