Skip to content

Commit

Permalink
changed wile to for
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanLiVa committed Apr 23, 2024
1 parent 1a44f5a commit 2220fec
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/games/evGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ const isEven = (count) => {

const askNumberQuestions = () => {
const userName = greeting('Answer "yes" if the number is even, otherwise answer "no".');
let i = 0;
while (i < 3) {
for (let i = 0; i < 3; i += 1) {
const question = Math.floor(Math.random() * 100);
const rightAnswer = isEven(question);
const isCorrect = mainLogicGame(question, rightAnswer, userName);
if (isCorrect) {
i += 1;
} else {
if (!isCorrect) {
return;
}
}
Expand Down

0 comments on commit 2220fec

Please sign in to comment.