The rules of rock, paper ,scissors....rope?


#1

//Your choice
var userChoice = prompt("Do you choose rock, paper or scissors?");
//The CPU's choice
var computerChoice = Math.random();
if (computerChoice < 0.34) {
	computerChoice = "rock";
} else if(computerChoice <= 0.67) {
	computerChoice = "paper";
} else {
	computerChoice = "scissors";
//Telling you what the computer chose
} console.log("Computer: " + computerChoice);
//Seeing if you won/lost
var compare = function (choice1,choice2){
    if (choice1 === choice2)
    {
        return "The result is a tie!";
    }
    else if(choice1 === "rock")
    {
        if(choice2 === "scissors")
        {
            return "You win!"
        }
        else
        {
            return "Computer wins!"
        }
    }
    else if(choice1 === "paper")
    {
        if(choice2 === "rock")
        {
            return "You win!"
        }
        else
        {
            return "Computer wins!"
        }
    }
    else if(choice1 === "scissors")
    {
        if (choice2 === "rock")
        {
            return "Computer wins!"
        }
        else
        {
            return "You win!"
        }
    }
    else
    {
        return "That is not a valid choice!"
    }
}
compare(userChoice,computerChoice)

I want to update this so it has a rope option, and I was looking for if anybody knew what the rules would be before I added "rope" in.


#2

#3

Thanks! I guess I would have to add something else along with "rope"