0

我需要使用大写字母吗?

var userChoice=prompt("Do you choose rock, paper or scissors?");
var computerChoice=Math.random();
if (computerChoice>0 && computerChoice<0.33)
   {
     computrChoice=("rock");
   }
else if (computerChoice>0.34 && computerChoice<0.66)
    {
      computerChoice=("paper");
    }
else{computerChoice=("scissors");}
    console.log(computerChoice);
4

1 回答 1

0
var userChoice=prompt("Do you choose rock, paper or scissors?");
var computerChoice=Math.random();
if (computerChoice>0 && computerChoice<0.33)
   {
     computrChoice=("rock");        <<---- you have spell error here
   }
else if (computerChoice>0.34 && computerChoice<0.66)
    {
      computerChoice=("paper");
    }
else{computerChoice=("scissors");}
    console.log(computerChoice);
于 2013-10-09T04:05:42.060 回答