Please help me thanks


#1

/*var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);*/
var compare = function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie";
}
};


#2

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34){
        computerChoice = "rock";
    } 
else if(computerChoice <= 0.67){
        computerChoice = "paper";
    } 
else {
        computerChoice = "scissors";
    }
console.log("Computer: " + computerChoice);
var compare = function(choice1, choice2) {
    if(choice1 === choice2) {
        return "The result is a tie";
    }
};

There is my edited version of your code. I haven't tested it, but try it - it might work. If not I will give you my code.


#3

it still not working


#4

I don't know then, sorry!


#5

do you think that the code is wrong?


#6

Nope, it looks perfect to me.


#7

wow I guess I will skip it thank you so much!


#8

I believe after the function you have to call it using the "userChoice" and "computerChoice:" parameters.

compare(userChoice, computerChoice);

I'll have to look back to the lesson to make sure that's it but it may not be. Try it and see what you find from that.


#9

it's still not working. can you check what you did when you did this script.