Rock,Paper,Scissors ( Stuck)


#1

I am stuck, somewhat new to JavaScript

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

if (computerChoice <= 0.33){
console.log('Rock');
}
else if (computerChoice == 0.33 || >= 0.66){
console.log('Paper');
} else
console.log('Scissor')
}


#2

What seems to be the problem?


#3

Oops, try again. There was a problem with your syntax.
(I did miss out on a { after the else statement but that not even it nor the semicolon)


#4

Instead of me trying to fix it I added a new line of code and it fixed it
Heres the code

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

if (computerChoice <= 0.33){
console.log('Rock');
}
else if (computerChoice == 0.33 && computerChoice >= 0.66){
console.log('Paper')
} else {
console.log('Scissor')
}


#5

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