Computer choice: part two


#1

Here is my code. I keep getting "TypeError: Function Expected" as a reply.

What am I doing wrong?

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.66)
{
console.log="paper";
}
else
{
console.log = "scissors";
}


#2

Under each of the if, else if, else statements - I believe you are supposed to set the value of computerChoice based on the rules and then you log the value of computerChoice afterwards.

for example:
if (computerChoice <= 0.33){
computerChoice = "Rock"
} else if (computerChoice <=0.66){
computerChoice = "Paper"
} else {
computerChoice = "Scissors"
}
console.log (computerChoice)


#3

Tried that multiple times... no luck.

This is what my code looks like now:

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


#4

Ive just copy and pasted your code in to mine as a test and it works.. weird.
Maybe try a refresh? no idea, sorry.


#5

When you say "no luck", could you describe exactly what is happening? Is there an error message? If so, what does it say?