it can't?
How can I make this playable then? I don't have a website.
And sure here ya go. I know it's messy lol.
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.rando
);
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}
var compare = function (userChoice, computerChoice) {
if (userChoice === computerChoice) {
return ("The result is a tie!");
}
if (userChoice === "rock") {
if (computerChoice === "scissors") {
return ("Rock Wins");
} else {
return ("Paper Wins");
}
if (userChoice === "paper") {
if (computerChoice === "scissors") {
return ("Scissors Wins!");
} else {
return ("Paper Wins!");
}
if (userChoice === "scissors") {
if (computerChoice === "rock") {
return ("Rock Wins");
} else {
return ("Scissors Wins");
}}}}};
console.log(compare(userChoice, computerChoice))
- - - Updated - - -
the smiley screwed up the top D: