4. computer choice part 2


#1


var userChoice = prompt("Do you choose rock, paper or scissors");
var computerChoice = Math.random();
console.log(computerChoice)

if (computerChoice <= 0.33){
    computerChoice === rock;
}

else if (computerChoice <=0.66){
    computerChoice === paper;
}

else{
    computerChoice === scissors;
}

i can't get it working please help


#2

you should set the computerChoice to rock, paper or scissors (using a single equal sign)

rock, paper and scissors are strings, don't forget to use quotation marks (") when dealing with strings


#3

Thanks for the help it worked


#4

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