Rock paper scissors problem


i am stuck here it gives syntax error

var userChoice=prompt("Do you choose rock, paper or scissors?");
var computerChoice=Math.random();
if (computerChoice<=0.33){
   else if (computerChoice<=0.66){
    else (computerChoice>0.66){


HI the else statement doesn't take any condition so remove it here

else (computerChoice>0.66){

if (condition){

else if (condition) {

else {



I am having the problem of errors and I don't know what I did wrong.
need a little of help.


Hi remove all the ; you put after the closing } of your if, else if and else stastement


Thank you.Now its working


It appears the conditions are incorrect. Since all possibilities are contained in the "rock" and "paper" parts, you will never get "scissors." Although I didn't get mine to work yet, mine says:

if (computerChoice <= .33) {
computerChoice = "rock";
} else if (computer Choice <=.66) {
computerChoice = "paper";
} else {
computerChoice = "scissors";


It worked to many of the ( ';'). Thanks for the help.


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