Help on "rock paper scissors"


#1


Hi i'm stuck on exercise 5/9 "Both choices are the same!" My code didn't work but even the copy paste of the hint doesn't work and i'm kind of stuck


var compare = function(choice1, choice2) {
    if(choice1 === choice2) {
        return "The result is a tie";
    }
};


#2

This code is fine, can you please copy and paste the rest of your code. And the exercise URL.


#3

Thanks for answering so fast.

url is : https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/1?curriculum_id=506324b3a7dffd00020bf661

and the rest of the code is :

/*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";
}
};


#4

This is going to annoy you but this is missing a exclamation mark.


#5

I knew it was something small thanks a lot, i would suggest including it to the hint maybe ? Comparing it and mine i didn't see the difference.


#6

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