Hello! it seems that there is a problem with my Rock, Paper, Scissors! game code.
Here is the code i’ve made. I already counted the courlybraces and i dont know what else to do.
Here is the code:
const getUserChoice = userInput => {
userInput.toLowerCase()
if(userInput === 'rock' || userInput === 'paper' || userInput === 'scissors') {
return userInput;
} else {
return console.log('Error')
}
}
function getComputerChoice () {
let randomNumber = Math.floor(Math.random() * 3);
switch (randomNumber) {
case 0:
return 'rock';
break;
case 1:
return 'paper';
break;
case 2:
return 'scissors';
break;
}
}
function determineWinner(userChoice, computerChoice) {
if(userChoice === computerChoice) {
return 'Tied Game!';
} else {
if (userChoice === 'rock'){
if (computerChoice === 'paper'){
return 'Looser!';
} else {
return 'Winner!'
}
}
} if (userChoice === 'paper'){
if (computerChoice === 'scissors'){
return 'Looser!';
} else {
return 'Winner1';
}
} if (userChoice === 'scissors') {
if (computerChoice === 'rock') {
return 'Looser!';
}else {
return 'Winner!'
}
}
and this is the error message:
/home/ccuser/workspace/javascript_101_Unit_3/Unit_3/rockPaperScissors.js:55
});
^
SyntaxError: Unexpected token )
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
can somebody help me? i cannot find the roblem!! :(((((