Help me with 4/9


#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 >= 0.34){
computerChoice = "paper";}
else {
computerChoice = "scissors";}
console.log("Computer: " + computerChoice);

Why this booleans dont work??
for any computerChoice value it print only "rock"((
where is my mistake?


#2

When you declared computerChoice, you forgot to have an input for the Math.random(), like so:

var computerChoice = Math.random(0,1);

#3

i tried nothing changed((


#4

You also forgot a semi colon at the end of your userChoice prompt:

var userChoice = prompt( "Do you choose rock, paper or scissors?");

#5

thanks))) i changed) but it mistake didnt involve for my problem))


#6

i thing something wrong with booleans but couldnt find mistake.


#7

Try removing the second input on your else if statement, like so:

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

And you also have commas instead of periods in your if statements (for the numbers)


#8

thank you !!!!!!!!!!!! it help, i change all commas for periods, and now it work correct!!!


#9

Yup, glad I could help.