Keep getting "Oops, try again. Did you set var computerChoice = Math.random() ? The capital 'M' in 'Math' is important!" need help((passed!))


#1

this is my code, I have used 3 different browsers

My code

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);


#2

This error message is an obvious bug in the lesson.


#3

I passed it with the exact same code you have right now... Try to refresh the page, or go back to the previous page, pass it and try again on that one.


#4

i got past the lesson thanks!!


#5

n/p :wink:     


#6

Which exercise is it? 3 or 4? Had a case today where someone tried to pass using a similar code for ex 3 and received the same error message. The problem was that the exercise expected to see a number but it already got converted into a string.


#7

It was the 4th I believe.
hears the code for 3 and 4

3's code

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

console.log(computerChoice);

4's code

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";
};


Hope this helps you out.