Loading

Scissors Paper Rock Game!

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>Scissors Paper Rock Game! </title>
  
  
  
  
  
</head>

<body>
  
<html>
<head>
<script>
  function myFunction() {
    var textfield1 = document.getElementById("textfield1");
    var input = textfield1.value;
    var input = input.toLowerCase();
    var cpu = Math.floor((Math.random() * 5) + 1);

    if (input == 1 || input == 2 || input == 3) { 
    } else if (input == "rock") {
      var input = 1;
    } else if (input == "paper") {
      var input = 2;
    } else if (input == "scissors") {
      var input = 3;
    } else {
      alert(" Input!"); 
      return;
    }

    if (input == 1 && cpu == 3) {
      alert("You Win! Rock beats scissors!");
    } else if(input == 2 && cpu == 1) {
      alert("You Win! Paper Over Rock!");
    } else if(input == 4 && cpu == 2) {
      alert("You Win! Scissors Cuts Paper");
    } else if (input == cpu) {
      alert("Its a tie!");
    } else {
      alert("You lose!");
    }
  }
</script>
</head>
<body align="center">
<img           src="https://31.media.tumblr.com/1bb16c331ba5cc303c0f370e9927c740/tumblr_inline_n2yc8uRLei1r6abro.jpg">
<br><br><br><h1><font size="10pt" face="Verdana" color="red">
Scissors Paper Rock Game!
Type In Your Answer!


</h1>
<input type="text" name="input1" id="textfield1">
</input><br>
<input type="button" name="button2" onclick="myFunction()" value="Go"><br><br>
<input type="number" name="myScore"value="0" randomly>
</body>
</html>
  
  
</body>
</html>
/* Downloaded from https://ahoj.co.uk/ */
/* Downloaded from https://ahoj.co.uk/ */

This awesome code is write by Doctor Chicke Soup, you can se more from this user in the personal repository