-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
119 lines (108 loc) · 5.94 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Syncopate:wght@400;700&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png">
<link rel="manifest" href="./favicon/site.webmanifest">
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
<title>Tic Tac Toe</title>
<meta name="description" content="Play Tic Tac Toe with AI">
<meta property="og:title" content=Tic-Tac-Toe with AI>
<meta property="og:site_name" content=Tic-Tac-Toe with AI>
<meta property="og:url" content=https://rahul-biswakarma.github.io/tic-tac-toe-ai />
<meta property="og:description" content="Play Tic Tac Toe against unbeatable AI">
<meta property="og:type" content=website>
<meta property="og:image"
content=https://raw.githubusercontent.com/rahul-biswakarma/tic-tac-toe-ai/master/banner.png>
</head>
<body>
<div id="winner-c">
<div id="winner">
<div id="close-winner">X</div>
<div id="winner-name" class="gradient-text">You Won</div>
</div>
</div>
<div class="player-card lg-player-card" id="human">
<h2>YOU</h2>
<div id="human-score" class="gradient-text">0</div>
</div>
<div id="board-c">
<div class="parent" id="board">
<div class="div1 board-cell" id="c00" dataI="0" dataJ="0"></div>
<div class="div2 board-cell" id="c01" dataI="0" dataJ="1"></div>
<div class="div3 board-cell" id="c02" dataI="0" dataJ="2"></div>
<div class="div4 board-cell" id="c10" dataI="1" dataJ="0"></div>
<div class="div5 board-cell" id="c11" dataI="1" dataJ="1"></div>
<div class="div6 board-cell" id="c12" dataI="1" dataJ="2"></div>
<div class="div7 board-cell" id="c20" dataI="2" dataJ="0"></div>
<div class="div8 board-cell" id="c21" dataI="2" dataJ="1"></div>
<div class="div9 board-cell" id="c22" dataI="2" dataJ="2"></div>
<div class="div10 separator"></div>
<div class="div11 separator"></div>
<div class="div12 separator"></div>
<div class="div13 separator"></div>
<div class="div14 separator"></div>
<div class="div15 separator"></div>
</div>
<button id="reset">Reset</button>
</div>
<div class="player-card lg-player-card" id="ai">
<h2>AI</h2>
<div id="ai-score" class="gradient-text">0</div>
</div>
<div id="sm-player-cards">
<div class="player-card" id="human">
<h2>YOU</h2>
<div id="human-score-sm" class="gradient-text">0</div>
</div>
<div class="player-card" id="ai">
<h2>AI</h2>
<div id="ai-score-sm" class="gradient-text">0</div>
</div>
</div>
<div id="icons-container">
<a href="https://github.com/rahul-biswakarma/tic-tac-toe-ai" target="_blank">
<svg id="github-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
class="feather feather-github">
<path
d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" />
</svg>
</a>
<svg id="settings-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-settings">
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z">
</path>
</svg>
</div>
<div id="settings-c">
<div id="settings">
<div id="settings-close">X</div>
<div>
<h2 class="gradient-text">Game Mode</h2>
<div id="game-modes">
<div id="easy-mod">Noob AI</div>
<div id="average-mod">Average AI</div>
<div id="hard-mod">Ruthless AI</div>
</div>
</div>
</div>
</div>
<script src="./game-files/randomPicker.js"></script>
<script src="./game-files/checkWinner.js"></script>
<script src="./game-files/utils.js"></script>
<script src="./game-files/minimax.js"></script>
<script src="./script.js"></script>
</body>
</html>