I have finished coding the rock scissor paper code, but when I input it and click run nothing happens. I am not getting any errors so not sure why the console remains blank. Did I miss something? Please help! Thank you
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === ‘rock’ || userInput === ‘paper’ || userInput ===‘scissors’) {
return userInput;
} else {
console.log(‘Error!’);
}
}
const getComputerChoice = () => {
const randomNumber = Math.floor(Math.random() * 3);
switch (randomNumber) {
case 0:
return ‘rock’;
case 1:
return ‘paper’;
case 2:
return ‘scissors’;
}
};
const determineWinner = (userChoice, computerChoice) => {
if (userChoice === computerChoice) {
return ‘This game was a tie’;
}
if (userChoice === ‘rock’) {
if (computerChoice === ‘paper’) {
return ‘Computer Wins’;
} else {
return ‘Player Wins’;
}
}
if (userChoice === ‘paper’) {
if (computerChoice === ‘scissors’) {
return ‘Computer wins’;
} else {
return ‘Player Wins’;
}
}
if (userChoice === ‘scissors’) {
if (computerChoice === ‘rock’) {
return ‘computer wins’;
} else {
return ‘player wins’;
}
}
};
const playGame = () => {
const userChoice = getUserChoice(‘paper’);
const computerChoice = getComputerChoice();
console.log('I picked ’ + userChoice);
console.log('Computer picked ’ + computerChoice);
console.log(determineWinner(userChoice, computerChoice));
};