Skip to content

Commit b5b9115

Browse files
committed
added some statements to check the result so as to update the scores
1 parent 01fcfe1 commit b5b9115

File tree

1 file changed

+7
-0
lines changed
  • Rock-Paper-Scissors-Game

1 file changed

+7
-0
lines changed

Rock-Paper-Scissors-Game/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,11 @@ function getResult() {
4646
resultDisplay.innerHTML = `<img src="./public/computer.png" alt="Computer" style="width: 10%;">`;
4747
resultDisplay.className = "you-lose";
4848
}
49+
if (result === "You win!") {
50+
score.wins += 1;
51+
} else if (result === "You lose!") {
52+
score.losses += 1;
53+
} else if (result === "It's a draw") {
54+
score.ties += 1;
55+
}
4956
}

0 commit comments

Comments
 (0)