-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
70 lines (57 loc) · 1.97 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
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head>
<meta charset="UTF-8">
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js"> </script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script language="javascript" type="text/javascript" src="rps.js"></script>
<!-- this line removes any default padding and style. you might only need one of these values set. -->
<style>
body {
padding: 0;
margin: 0;
}
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 28%;
padding: 10px;
height: 300px; /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
</style>
</head>
<body>
<script type="text/javascript">
function setMyMove(value) {
document.getElementById('pText').innerHTML = "My Move: " + value;
}
function setAgentMove(value){
document.getElementById('oText').innerHTML = "Agent Move: " + value;
}
</script>
<input type="button" value="ROCK" id="b1" onclick="setMyMove(this.value); setAgentMove(chooseMove(this.value))"/>
<input type="button" value="PAPER" id="b2" onclick="setMyMove(this.value); setAgentMove(chooseMove(this.value))"/>
<input type="button" value="SCISSORS" id="b3" onclick="setMyMove(this.value); setAgentMove(chooseMove(this.value))"/>
<p id="pText">My Move: </p>
<input type="button" value="Positive Reward" id="b4" onclick="train(100)"/>
<input type="button" value="Negative Reward" id="b5" onclick="train(-100)"/>
<p id="oText">Agent Move: </p>
<form>
<input type="radio" name="phase" value="train" checked> Train<br>
<input type="radio" name="phase" value="evaluate"> Evaluate<br>
</form>
<div class="row">
<div id="div1" class="column"> </div>
<div id="div2" class="column"> </div>
<div id="div3" class="column"> </div>
</div>
<script type="text/javascript">
init();
</script>
</body>
</html>