Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
Estoy creando un juego de piedra, papel o tijera y la función WinnerCheck no funciona.

// Puntaje //

let computerScore = 0 let playerScore = 0

 function playRound() { //My "choice"// let Answer = prompt(`Do you choose Rock,Paper or Scissors ?`).toLowerCase(); console.log(Answer); function computerPlay() { computerPlay = Math.floor(Math.random() * 3) if(computerPlay === 0) { console.log("rock"); } else if (computerPlay === 1) { console.log("paper"); } else if (computerPlay === 2){ console.log("scissors"); } } computerPlay() //The conditions for the game// if(Answer == "rock" && computerPlay === 0){ return ("Draw"); } else if(Answer == "rock" && computerPlay === 1 ){ computerScore += 1 return("You lost"); } else if(Answer == "rock" && computerPlay === 2){ playerScore += 1 return("You won"); } if(Answer == "paper" && computerPlay === 0 ) { playerScore += 1 return("You Won!"); } else if(Answer == "paper" && computerPlay === 1) { return("Draw"); } else if (Answer == "paper" && computerPlay === 2) { computerScore += 1 return("You Lost!"); } if(Answer == "scissors" && computerPlay === 0) { computerScore += 1 return("You Lost!") } else if(Answer == "scissors" && computerPlay === 1) { playerScore += 1 return("You Won!"); } else if(Answer == "scissors" && computerPlay === 2) { return("Draw!"); } }

//entonces esta función no funciona...| ¿Cómo puedo hacer que funcione? V// function winnerCheck() { if (computerScore === 5){ console.log("¡El jugador ganó!") } else if (playerScore === 5) { console.log("¡Computadora ganó!"); } }
ganadorCheque() ronda de juego()

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!