html
html
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
<!DOCTYPE html>
<html>
<head>
<h2 style="text-align:center" id="chooseMessage"><b>What do you choose?</b></h2>
<div id="picker">
<p><div style="text-align:center">
<p class="btn blue" id="rock" onclick="rock()">✊Rock✊</p>
<p class="btn blue" id="paper" onclick="paper()">✋Paper✋</p>
<p class="btn blue" id="scissors" onclick="scissors()">✂Scissors✂</p>
<a onclick="score()" class="btn green">What are the scores?</a>
<a onclick="reset()" id="reset" class="btn red">Reset scores</a>
<h3>Computer's choice:</h3>
<p id="randomNumber">0</p>
</div>
<script src="https://code.jquery.com/jquery-3.1.1.js">
$('hello').dialog( { modal:true, buttons:{ 'Save':function() {}, 'Delete':function() {} } } );
</script>
</p>
<title>Rock paper scissors</title>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
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
#scissors {
font-size:27px;
text-align:center;
}
#rock {
font-size:23px;
}
#paper {
font-size:23px;
}
#reset {
font-size:26px;
text-align:center;
}
#chooseMessage{
font-size: 185%;
}
@font-face {
font-family: 'socialfont';
src: url('http://mediaashley.com/MyFont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
Enter to Rename, Shift+Enter to Preview
js
js
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
alert("ALERT:\nPC support added!");
alert("You want likes on your code or followers?\nCome and advert anything from SoloLearn\nhttps://www.sololearn.com/Discuss/452626/?ref=app");
var playerScore = 0;
var computerScore = 0;
var computerChoice;
var computerWinStreak = 0;
var winStreak = 0;
var computerWinStreakDisplay;
var winStreakDisplay;
function rock() {
makeRandom();
if (computerChoice <= 0.33333333333333333){
alert("The computer chose scissors");
confirm("You won!\nThe computer lost");
playerScore += 1;
winStreak += 1;
computerWinStreak = 0;
alert("You are on a winstreak of " + winStreak + ".\nThe computers winstreak has been reset to 0!");
}
if (computerChoice > 0.66666666666666666) {
alert("The computer chose rock!");
alert("It's a tie!");
}
if (computerChoice >= 0.33333333333333333 && computerChoice <= 0.6666666666666666){
alert("The computer chose paper!");
alert("You lost!\nThe computer won");
computerScore += 1;
computerWinStreak += 1;
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run