-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoinflip.html
106 lines (84 loc) · 2.53 KB
/
coinflip.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<!--Joel Sejas -->
<html>
<head>
<title>CS80 Final</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<style>
.header {
padding: 1%;
background-color: #44464c;
border: 1px solid #e9e9e9;
}
.button {
background-color: whitesmoke;
border: none;
color: black;
padding: 15px 25px;
text-align: center;
font-size: 16px;
cursor: pointer;
}
.button:hover {
background-color: dimgrey;
</style>
</head>
<body bgcolor="#5a6070" text="#FFFFFF" alink="#FFFFFF" vlink="#00CCFF">
<div class="header">
<h1>CS80 Final Project</h1>
</div>
<br>
<table width="312" border="0" cellpadding="10" height="50" align ="center">
<tr align="center" valign="middle">
<td width="288">
<div align="center"><b><font color="#FFFFFF" size="5" face="Georgia, Times New Roman, Times, serif">Coin Flip</font></b></div>
</td>
</tr>
</table>
<br>
<table width="200" border="2" cellpadding="5" height="800" align ="left">
<tr align="left" valign="top">
<td width="187" height="173">
<ul>
<li><b><a href = "main.html"><font color="#FFFFFF">Home</font></a></b></li>
<li><b><a href = "ppuzzel.html"><font color="#FFFFFF">Picture Puzzel</font></a></b></li>
<li><b><a href = "coinflip.html"><font color="#FFFFFF">Coin Flip</font></a></b></li>
<li><b><a href = "rps.html"><font color="#FFFFFF">Rock Paper Scissors</font></a></b></li>
</ul>
</td>
</tr>
</table>
<table width="5%" height="400" border="0" cellpadding="1" cellspacing="0" align="left">
<tr align="left" valign="top">
<td ></td>
</tr>
</table>
<script type="text/javascript">
var luck = Math.random();
if (luck < 0.5) {
luck = "heads";
} else {
luck = "tails";
}
document.write("<p> Face:" + " " + luck + "</p>");
//display
if(luck == 'heads')
{
document.writeln("<p>");
document.writeln(" <img src=\"heads.png\" alt=\"quarter face up\">")
document.writeln("</p>");
}
else
{
document.writeln("<p>");
document.writeln(" <img src=\"tails.png\" alt=\"quarter tails up\">")
document.writeln("</p>");
}
</script>
<p>
<a class="button" href="coinflip.html" >Try Again</a>
</p>
<br>
</body>
</html>