What am I doing wrong?


#1

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

what am I doing wrong?


#2

Math.random has no parameter so the 1 is not necessary, but this is just a minor problem. What is your error message? At first glance it seems to be ok. Maybe just refresh and try again.


#3

Oops, try again. Did you set var computerChoice = Math.random() ? The capital 'M' in 'Math' is important!
This is the message that opens


#4

Is this exercise 3 or 4? If it is 3 this would be too much an you should only print the random number. If it is 4 this should be correct and maybe you just need to refresh the page.


#5

haxor789 it is the 3 what am I doing wrong? what to do?


#6

i funt the mistake thanks, you are rigth i had only to print the random number