-
Notifications
You must be signed in to change notification settings - Fork 0
/
kicktest.html
54 lines (54 loc) · 1.56 KB
/
kicktest.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
<html>
<script>
function setArrays(input) {
var result = input;
for (var inx = 0; inx < input.xpmakes; inx++){
result.makes.push(20);
}
for (inx = 0; inx < input.xpmisses; inx++){
result.misses.push(20);
}
return result;
}
function go() {
var current, tr, td, string;
var testtable = document.getElementById("testtable");
for (var inx = 0; inx < input.length; inx++){
current = input[inx];
tr = document.createElement("tr");
td = document.createElement("td");
td.innerHTML = current.makes.length ? current.makes.join(",") : "-";
tr.appendChild(td);
td = document.createElement("td");
td.innerHTML = current.misses.length ? current.misses.join(",") : "-";
tr.appendChild(td);
td = document.createElement("td");
td.innerHTML = current.xpmakes;
tr.appendChild(td);
td = document.createElement("td");
td.innerHTML = current.xpmisses;
tr.appendChild(td);
temp = setArrays(input[inx]);
td = document.createElement("td");
td.innerHTML = Math.round(calculate (temp.makes, temp.misses) * 10000.0) / 100.0 + "%";
tr.appendChild(td);
testtable.appendChild(tr);
}
}
</script>
<script src="javascripts/kick.js"></script>
<script src="javascripts/kicktest.js"></script>
<body onload="go()">
<table border="1px solid black" style="border-collapse:collapse;">
<tbody id="testtable">
<tr>
<th>Makes</th>
<th>Misses</th>
<th>XP Makes</th>
<th>XP Misses</th>
<th>Rating</th>
</tr>
</tbody>
</table>
</body>
</html>