Skip to content

Commit

Permalink
Step 1: remove logic that plays exactly five rounds
Browse files Browse the repository at this point in the history
  • Loading branch information
wilyJ80 committed Jan 6, 2024
1 parent 5141a9b commit 12a807a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rockpaperscissors/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function playRound(playerSelection, computerSelection) {
function game() {

let playerWins = 0, computerWins = 0;
let count = 0;
/* let count = 0;
while (count < 5) {
console.log("Round " + (count + 1));
console.log("Round " + (count + 1)); */

let playerChoice = prompt("Rock, Paper, Scissors?");
let computerChoice = getComputerChoice();
Expand All @@ -78,13 +78,13 @@ function game() {

if (result.startsWith("You win")) {
playerWins++;
count++;
// count++;

} else if (result.startsWith("You lose")) {
computerWins++;
count++;
// count++;
}
}
// }

// Final game outcome
if (playerWins > computerWins) {
Expand Down

0 comments on commit 12a807a

Please sign in to comment.