Skip to content

Commit

Permalink
fix duplicate replay button bug
Browse files Browse the repository at this point in the history
  • Loading branch information
im-pramesh10 committed Aug 17, 2024
1 parent 1ff2355 commit 1d53451
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class Game {
this.physicalKeyboardHandler();
}
newGame() {
this.word = wordlist[Math.floor(Math.random() * wordlist.length)];
// this.word = wordlist[Math.floor(Math.random() * wordlist.length)];
this.word = "hello";
this.currentRow = 0;
this.activeCell = 0;
this.gameState = "playing"; // playing, won, lost
Expand Down Expand Up @@ -193,8 +194,7 @@ class Game {
this.gameState = "won";
this.showCorrectWord(this.word);
this.showReplayButton();
}
if (this.currentRow === 5) {
}else if (this.currentRow === 5) {
this.showCorrectWord(this.word);
this.showReplayButton();
if (textcontent !== this.word) {
Expand Down

0 comments on commit 1d53451

Please sign in to comment.