Skip to content

Commit

Permalink
fix: terminate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sazanik committed Nov 7, 2024
1 parent 614999e commit ce4ce48
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ class BrainGames {

console.log(description);

const answers = [];

for (let i = 0; i < this.attemptsCount; i += 1) {
answers.push(game());
}
if (!game()) {
this.sympathize(this.name);

return;
}

if (answers.every(Boolean)) {
this.congratulate(this.name);
} else {
this.sympathize(this.name);
}
}
}
Expand Down

0 comments on commit ce4ce48

Please sign in to comment.