Build Rock Paper Scissors lesson 4 HELP


#1


Build "Rock, Paper, Scissors" Computer Choice: Part 2


I have my code written perfectly, but it says I have a sytax error of {. I even had my friend, who has mastered code btw, say it was correct. WHAT!!! SOMEONE LOOK AT IT PLZ


Replace this line with your code. 
var userChoice = prompt("Do you choose rock, paper, or scissors?");
var computerChoice = Math.random();
if (computerChoice === 0 - 0.33) {
	computerChoice === "rock";
} else if (compouterChoice === 0.34 - 0.66) {
	computerChoice === "paper";
} else(computerChoice === 0.67 - 1) {
	computerChoice === "scissors";
}
console.log(computerChoice);


#2

in javascript dash/hyphen (-) is used for subtracting:

console.log(5 - 3); // will log 2

you need to change your if and else if condition, what do you think you need?

else can't have a condition at all since it is everything else


#3

Oh that's right. Will don't I look like an idiot. Thank you


#4

programming is difficult. We all make mistakes, that is why we have a forum, so we can help you

did you resolve the issue?


#5

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