This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Rashad Glover
about 10 years

I'm stuck on 4/8 rock papers etc.. Can someone show me how it's done?

Can someone show me how it’s done?

Answer 534fbfb6548c35dc08001401

0 votes

Permalink

var userChoice = prompt(“Do you choose rock, paper or scissors?”); var computerChoice = Math.random(); console.log(computerChoice); if (computerChoice < 0.33) { computerChoice = “rock”; } else if (computerChoice <= 0.66) { computerChoice = “paper”; } else { computerChoice = “scissors”; }

points
Submitted by Patrick Marx
almost 10 years