-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (94 loc) · 2.82 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tic Tac Toe NN</title>
<style>
body {
font-size: large;
font-family: sans-serif;
background-color:#ffa502;
text-align: center;
}
#play-area {
margin: 2em;
}
#settings, #controls {
margin: 1em;
}
#x-settings, #o-settings {
margin: 1ex;
}
#status {
width: 300px;
text-align: center;
}
#copyright {
margin: 1em;
font-size: small;
text-align: center;
font-style: italic;
}
</style>
</head>
<body>
<div id="play-area" style="align-self: center;">
<canvas id="board" width="300" height="300"></canvas>
<div id="status"
data-empty=" "
data-winner-x="X wins!"
data-winner-o="O wins!"
data-tie="It's a TIE!"
data-paused="AI paused"
data-thinking="Thinking..."
> </div>
</div>
<div id="settings">
<div id="x-settings">
X:
<select id="x-control">
<option value="human" selected>Human</option>
<option value="ai-random">AI: random</option>
<option value="ai-easy">AI: easy</option>
<option value="ai-smart">AI: smart</option>
<option value="ai-neural">AI: neural net</option>
</select>
<br>
<textarea id="x-ai-neural-import"
placeholder="Select "AI: neural net" & paste in a net"
disabled
></textarea>
</div>
<div id="o-settings">
O:
<select id="o-control">
<option value="human" selected>Human</option>
<option value="ai-random">AI: random</option>
<option value="ai-easy">AI: easy</option>
<option value="ai-smart">AI: smart</option>
<option value="ai-neural">AI: neural net</option>
</select>
<br>
<textarea id="o-ai-neural-import"
placeholder="Select "AI: neural net" & paste in a net"
disabled
></textarea>
</div>
</div>
<div id="controls">
<!-- input id="pause" type="button" value="Pause AI"
data-paused="Resume AI" data-unpaused="Pause AI">
<input id="step" type="button" value="Step AI">-->
<input id="undo" type="button" value="Undo">
<input id="restart" type="button" value="Restart">
</div>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
<script src="src/ttt.js"></script>
<script src="src/neural.js"></script>
<script src="src/ai.js"></script>
<script src="src/genetic.js"></script>
<script src="play.js"></script>
</body>
</html>