Skip to content

Commit

Permalink
Changed BrainProgression.php
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rysaev committed May 11, 2020
1 parent 74a7033 commit 15d67e3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions games/BrainProgression.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ function brainProgression()
$progression[] = $progression[$i] + $step;
}
$answer = $progression[$maskedPosition];
$maskedProgression = [];
for ($i = 0; $i < 10; $i++) {
if ($i !== $maskedPosition) {
$maskedProgression[] = $progression[$i];
} else {
$maskedProgression[] = "..";
}
}
line("Question: {:0} {:1} {:2} {:3} {:4} {:5} {:6} {:7} {:8} {:9}", $maskedProgression);
$progression[$maskedPosition] = '..';
line("Question: {:0} {:1} {:2} {:3} {:4} {:5} {:6} {:7} {:8} {:9}", $progression);
$guess = prompt('Your answer');
$answerAndGuess = [(int) $answer, (int) $guess];
return $answerAndGuess;
Expand Down

0 comments on commit 15d67e3

Please sign in to comment.