"Rock Paper Scissors Game"
Bootstrap 4.1.1 Snippet by karanbohara0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rock Paper Scissors</title>
<link rel="stylesheet" href="06-rock-paper-scissors.css">
</head>
<body>
<div class="all">
<p>Let's play Rock Paper Scissors</p>
<button id="button1" onclick="playGame('Rock')">Rock</button>
<button id="button2" onclick="playGame('Paper')">Paper</button>
<button id="button3" onclick="playGame('Scissors')">Scissors</button>
</div>
<script>
let win = 0;
let loss = 0;
let tie = 0;
function pickComputerMove() {
const randomNumber = Math.random();
let computerMove = '';
if (randomNumber >= 0 && randomNumber < 1/3) {
computerMove = 'Rock';
} else if (randomNumber >= 1/3 && randomNumber < 2/3) {
computerMove = 'Paper';
} else {
computerMove = 'Scissors';
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#button1{
height: 100px;
width: 100px;
background-color:white;
/* color: white; */
border-radius: 100%;
border: 2px solid black;
margin-left:80px;
margin-top: 90px;
background-image: url(https://images.unsplash.com/photo-1614032686163-bdc24c13d0b6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8cm9jayUyMHBhcGVyJTIwc2Npc3NvcnN8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=1000&q=60);
background-size: cover;
font-weight: 800;
}
p{
font-size: 90px;
margin-left:70px;
font-weight: 800;
}
#button2{
height: 100px;
width: 100px;
background-color:white;
/* color: white; */
border-radius: 100%;
border: 2px solid black;
margin-left:80px;
margin-top: 0px;
background-image: url(https://images.unsplash.com/photo-1614032686158-b880f7e82c18?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8cm9jayUyMHBhcGVyJTIwc2Npc3NvcnN8ZW58MHx8MHx8fDA%3D&auto=format&fit=crop&w=600&q=60);
background-size: cover;
font-weight: 800;
}
#button3{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: