What's wrong? 5/9


#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);
console.log("User: " + userChoice);
var compare = function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie";
}
};
compare(userChoice,computerChoice);


Oops, try again. Your compare function does not return 'The result is a tie!' when there is a tie.


Computer: rock
User: rock
"The result is a tie"


#2

for this exercise, only have the compare function (not the creation of userChoice and computerChoice, not even a function call), to much code can confuse the exercise


#3


#4

pfff.. strings returned should be an exact match, you are missing the exclamation mark at the end of the string


#5

Thanks!!! My inattention stole your and my time!


#6

oh sorry, the pfff... wasn't towards you. Was more a general one against this kind of silly mistakes. Np, if there where no silly mistakes, this forum would be pretty dead, good you can continue :slight_smile: