Code academy friends, I need you :) , stuck in 8/9 ! :(


I am stuck at the 8/9 level " what if choice1 is scissors?"

Hello, I don't know what's wrong with my code, can you help me? Thanks

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!";}
else if
(choice1 === "paper")
    (choice2 === "rock")
    { return "paper wins";}
    { return "scissors wins";};};

else if
(choice1 === "scissors")

    (choice2 === "rock")
    { return "rock wins";}
    { return "scissors wins";}

    Thank you


I've been staring at this for like ten minutes now just to be sure but you seem to be missing a statement for choice1===rock


@lord_cypher makes a good observation.

I would suggest looking at your syntax following both of your { return "scissors wins" } code blocks.


Hello, I have reset the code in order to restarting all, because I haven't found the problem source.
Thank you for your time anyway, that's nice of you :slight_smile:


Hello, thank you for your reply :slight_smile:


@webcoder06293 Don't give up, your code is very close to being done. Do a google search for jsbin and plug your code in on that site, it helped me a lot. You can do it!


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