9/9 Finishing up


#1

Not sure what's going on, working to put the finishing touches on my game and I must've missed something. Any thoughts?

var userChoice = prompt("Do you choose rock, paper, scissors or rope?");

var computerChoice = Math.random();
if (computerChoice <= 0.25) {
computerChoice = "rock";
} else if(computerChoice <= 0.50) {
computerChoice = "paper";
} else if (computerChoice <= 0.75) {
computerChoice = "scissors";
} else (computerChoice <= 1) {
computerChoice = "rope";
console.log("Computer: " + computerChoice);
var compare = function(choice1, choice2) {
if (choice1 === choice2) {
return "The result is a tie!";
}

else if (choice1 === "rock") {

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

else if (choice1 === "paper") {

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

else if (choice1 === "scissors") {

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

else if (choice1 === "rope") {

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

    else if (choice2 === "paper") {
        return "no one wins";
    }
    else {
        "rope wins";
    }
}

else {
    return "your text is invalid";
}

};
var userChoice;
var computerChoice;


#2

Remove bold text, before the compare function.