Computer Choice: Part 2


#1

EDIT: IGNORE I FIGURED IT OUT



https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/0/4?curriculum_id=506324b3a7dffd00020bf661

there was a problem with your syntax

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

var computerChoice = Math.random()
console.log(computerChoice)

if (computerChoice <= .33){
    computerChoice = "rock"
    }
else if (computerChoice >=.34 && computerChoice <= .66){
    computerChoice = "paper"
    }
else{
    computerChoice = "scissors"}
    }


#2

computerChoice = "scissors"}
} //remove
@jaelee45


#3

why would i remove that?


#4

TRY THIS ...
var userChoice = prompt("Do you choose rock, paper or scissors?");
computerChoice = Math.random();
console.log(computerChoice) ;
if (computerChoice >0 && computerChoice <0.33)
(computerChoice = "Rock");

else if(computerChoice > 0.34 && computerChoice <0.66)
computerChoice = "paper";

else (computerChoice > 0.67 && computerChoice <=1)
(computerChoice = "Scissors");


#5

because you already closed else statement :slight_smile:
see

else{
computerChoice = "scissors"}// here
} // and here