Looks like the right code but


#1


Build "Rock, Paper, Scissors"


I keep getting a syntax error, but as far as I can tell, this looks just like other's build that I've seen in this forum...


var userChoice = prompt( "Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice <= 0.33)
{ 
    computerChoice = "rock";
} 
else if (computerChoice > 0.33 && computerChoice < 0.67 ); 
{
    computerChoice = "paper";
}
else (computerChoice > 0.66)
{ 
    computerChoice = "scissors";
}
console.log(computerChoice);


#2

else if (computerChoice > 0.33 && computerChoice < 0.67 ); // remove ;

and you dont need to write like this.
you can write like

else if ( computerChoice < 0.67)

and
else doesn't allow to have a condition.and you dont need that too


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.