Rock, Paper Scissors Exercice

Hello, I seem to have done everything correct on the Rock, Paper and Scissors Project but the “Up Next” button is disabled and won’t let me proceed but my code is running as expected with no errors. Here’s the link:
https://www.codecademy.com/courses/introduction-to-javascript/projects/rock-paper-scissors-javascript

let userInput = "bomb"
userInput = userInput.toLowerCase()
const getUserChoice = userInput => {
  if (userInput === 'rock' || userInput ==='paper' || userInput === 'scissors' || userInput === 'bomb') {
    return userInput
  } else {
    console.log('Invalid Choice')
  }
}
const getComputerChoice = () => {
   switch (Math.floor(Math.random() * 3)) {
    case 0:
      return 'rock';
    case 1:
      return 'paper';
    case 2:
      return 'scissors';
   }
}
//let userChoice = getUserChoice(userInput)
//let computerChoice = getComputerChoice()

const determineWinner = (userChoice, computerChoice) => {
  if (userChoice === 'bomb'){
    return 'user won'
  }
  if (userChoice === computerChoice) {
    return 'game tie'
  }
  if (userChoice === 'rock') {
    if ( computerChoice === 'paper'){
      return 'computer won'
    } else{
      return 'user won'
    }
  }
  if (userChoice === 'paper') {
    if (computerChoice === 'scissors') {
      return 'computer won'
    } else {
      return 'user won'
    }
  }
  if (userChoice === 'scissors') {
    if (computerChoice === 'rock') {
      return 'computer won'
    }else {
      return 'user won'
    }
  }
}

const playGame = () => {
  const userChoice = getUserChoice('bomb')
  console.log('you threw: ' + userChoice)
  const computerChoice = getComputerChoice()
  console.log('computer threw: ' + computerChoice)
  console.log(determineWinner(userChoice, computerChoice))
}
playGame()

My bad, I just realised I had not Marked one of the tasks as complete by checking it off. :see_no_evil:

2 Likes