Max i need help


#1

ok i need alot of help ine thius

var userChoice = prompt("Do")
var computerChoice = Math.random();
console.log(computerChoice);
if (computerChoice  <= 0.33 )
{



{
    else if (computerChoice >= 0.66) {
        
        computer

i am having erroes max plz c and p

tnxs


#2

Your code seems pretty splattered is this intended or was there a problem copy and pasting it?

The general idea is that you have a random number between 0 and 1 and you want to decide what the computer chooses based on this number. So you divide this range in 3 almost equaly sized sub ranges e.g cc < 0.33, cc <0.66 and the rest. Now you need formalize this into code.


#3

var userChoice = prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random();
console.log(computerChoice);
if (computerChoice <= 0.33)
{
computerChoice = " " + "rock";
console.log ("Computer choose" + computerChoice);

}

else if (computerChoice >=0.66) {

computerChoice = " " + "paper";
console.log ("Computer choose" + computerChoice);
}

var compare = function(choice1, choice2)

{
if(choice1===choice2)
{
return("The result is a tie!");
}
if(choice1==="rock")

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

corgis are lief