I don't see what is wrong, Q = 5


#1

Hi I am sorry but I haven't coded in ages, I would love to have some help as I do not know what I have done wrong :
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";
}
};

thanks!


#2

@dog7518,
You will have to extend your return-Value with an exclamation mark

return "The result is a tie!";

Please read
http://www.codecademy.com/forum_questions/559dcb4be39efe550f00006b
and concentrate on:

  • the creation of the compare function
  • the truth-table
  • the build of the IF ELSE-IF statement structure as part of the compare FUNCTION-BODY
  • the execution of the compare function (keeping in mind that the return statement is used )

#3

Thank you! You really helped me, although when I first did that (which I did) it did not work so I did not do it again, but now it works thank you !