-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (55 loc) · 1.71 KB
/
index.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
<HTML>
<HEAD>
<TITLE>Random Coin Flipper</TITLE>
<SCRIPT language="javascript">
var number = 0;
var interval = null;
var current = 0;
var step = 1;
function flipit() {
if (interval != null) return;
number = Math.floor((Math.random() * 4) + 10);
interval = setInterval(coinize,25);
}
function coinize() {
var coin = document.getElementById("coin");
var next = document.getElementById("coin" + current);
coin.src = next.src;
if (current == 9) {
step = -1;
number = number - 1;
}
if (current == 0) {
step = 1;
number = number - 1;
}
current = current + step;
if (number == 0) {
clearInterval(interval);
interval = null;
}
}
</SCRIPT>
</HEAD>
<BODY style="background: black; text-align: center;">
<TABLE width="100%" height="100%" border="0">
<TBODY>
<TR>
<TD valign="center" align="center">
<IMG src="0.jpg" id="coin" onclick="flipit();"/>
</TD>
</TR>
</TBODY>
</TABLE>
<IMG src="0.jpg" width="1" height="1" id="coin0"/>
<IMG src="1.jpg" width="1" height="1" id="coin1"/>
<IMG src="2.jpg" width="1" height="1" id="coin2"/>
<IMG src="3.jpg" width="1" height="1" id="coin3"/>
<IMG src="4.jpg" width="1" height="1" id="coin4"/>
<IMG src="5.jpg" width="1" height="1" id="coin5"/>
<IMG src="6.jpg" width="1" height="1" id="coin6"/>
<IMG src="7.jpg" width="1" height="1" id="coin7"/>
<IMG src="8.jpg" width="1" height="1" id="coin8"/>
<IMG src="9.jpg" width="1" height="1" id="coin9"/>
</BODY>
</HTML>