Sinbad Konick

Rock, Paper, Scissor with computer choice – javaScript Code

This is done by using the Math.random() function in javaScript. If you look at the code you will understand it easily.
Math.random() variable will equal to a number between 0 to 1. 

Please make sure you align and indent the code after you copy.

var userChoice = prompt(“Do you choose rock, paper or scissors?”);

var computerChoice = Math.random();
if (computerChoice < 0.34)
{
computerChoice = “rock”;
}
else if(computerChoice <= 0.67)
{
computerChoice = “paper”;
}
else
{
computerChoice = “scissors”;
}

read more

hogan outlet online scarpe hogan outlet nike tn pas cher tn pas cher nike tn 2017 nike tn pas cher air max pas cher air max pas cher air max pas cher air max pas cher air max pas cher scarpe hogan outlet scarpe hogan outlet scarpe hogan outlet scarpe hogan outlet scarpe hogan outlet scarpe hogan outlet chaussures louboutin pas cher chaussures louboutin pas cher chaussures louboutin pas cher chaussures louboutin pas cher chaussures louboutin pas cher chaussures louboutin pas cher