Head meet brick wall? Can anyone offer syntax help?


#1

var playerShoot = prompt("Rock, Paper, Scissors...Shoot!");

var compShoot = function (Math.random()){

if (Math.random() >= .67);  
{return "Paper"};
else if(Math.random() <= .33);
{return "Rock"}; 
else;  
{return "Scissors"};

}

var rockPaperScissors = function (playerShoot , compShoot){
if (playerShoot = "Rock" && compShoot = "Scissors");
{return "Rock beats Scissors. Player Wins!"};

else if (playerShoot = "Rock" && compShoot = "Paper");
{return "Paper beats Rock. Computer Wins."};

else if (playerShoot = "Paper" && compShoot = "Rock");
{return "Paper beats Rock. Player Wins!"};

else if (playerShoot = "Paper" && compShoot = "Scissors");
{return "Scissors beats Paper. Computer Wins."};

else if (playerShoot = "Scissors" && compShoot = "Paper");
{return "Scissors beats Paper. Player Wins!"};

else if (playerShoot = "Scissors" && compShoot = "Rock");
{return "Rock beats Scissors. Computer Wins."};

else; 
{return "It's a Tie"};

}


#2

No semicolons after conditions. Have a look at this for a longer explanation: