Lesson 4 Computer Choice: Part 2


#1


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


i get error massage that say.
SyntaxError: Expected ';'


var userChoice = prompt ("Do you choice Rock,Paper or Scissors")
var computerChoice = Math.random()
if (0 < comuterChoice < 0.33){
   computerChoice ==="rock";
}
else if (  0.34 < computerChoice < 0.66) {
    computerChoice ==="paper";
}
else (0.67 < computerChoice < 1){
    computerChoice ==="scissors";
}

* List item


#2

if you want to do multiply comparison (greater then zero and smaller then .33) you need a and (&&) or an or (||) operator. but you don't need this, given the value is between zero and one you can just do:

if less then .34
if less then .67
else

(the above is pseudo code)

Also, else can't have a condition. Oh, and you need to update your computerChoice variable (assigning new value, single equal sign), not compare

If problems persist, post an updated version of your code


#4

it keep sending me
SyntaxError: Syntax error

var userChoice = prompt ("Do you choice Rock,Paper or Scissors")
var computerChoice = Math.random()
if (comuterChoice =< 0.34){
computerChoice ="rock";
}
else if (computerChoice =< 0.67) {
computerChoice ="paper";
}
else {
computerChoice ="scissors";
}


#5

It probably can't figure out what you mean by comuterChoice there.


#6

I still get the same error


#7

if (comuterChoice =< 0.34) // check spelling and write <= instead of =<

#8

thanks for Your help it worked