-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
137 lines (124 loc) · 11.1 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="tictactoe.css" />
</head>
<body>
<h1>Tic Tac Toe</h1>
<table>
<tr>
<td>
<img id="first" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
<td>
<img id="second" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
<td>
<img id="third" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
</tr>
<tr>
<td>
<img id="fourth" onclick=" play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
<td>
<img id="fifth" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
<td>
<img id="sixth" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
</tr>
<tr>
<td>
<img id="seventh" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
<td>
<img id="eight" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
<td>
<img id="ninth" onclick="play(this)"
src="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
alt="" />
</td>
</tr>
</table>
<script>
let turn = 0;
function play(block) {
if (
block.src ==
"https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6"
) {
if (turn % 2 == 0) {
block.src =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAeFBMVEX///8JBQkAAAD29vbm5ubq6ur7+vtBPkEaFxoYFRgdGh1APUA8OTwVEhUTDxM9Oz0gHiDZ2dmenZ5TUVPw8PB+fX5ubW7NzM1cWlypqKl1dHUxLzFjYmOGhYa3trd9fH0nJSeQkJBMSky/v7+wr7BGRUbKysqXlpepzqFLAAAJDUlEQVR4nNVdaXejOgwlzjbTadNsbZo2bdN0+///8AEBJ4AxtmQt737pmTM2RzfWtSQMIstaWK2fNy+Lm/nh9W3b/j+12L69HuY3i5fN83rlH7l7X5oCo1H5Z7P+P5DcrjfXRi/fd71DV4dy3AXG3K1njLZCMFvftY02B/dCjh+bI6vhizdmk+PwtnBa/TjuDl397Y48j37gtzsYDw5+pdV/O8v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y31KZyY92LhKzPh8npdCqDkXVi5lJCruN5JRylxtOYdWArY0jkXIcfeJc5y3niBnHSSgOuB74WCWc4wmggtW82bCKrg243DesbG881t52gTQZhejpHDiYTJ39s78LFAfyE+41rVPFZfYnNI+4OqDMSX3uud4QmApGi0VLiznzc8NCQ7LSCJnOjYaKR3cOtYjnDTFO/9mEgd+ROce1fP58Y+l8jws3ct5HP0iCGLk8X6+q+5m595vFyPwze7WRXdX01ZUharv/80c7HIjNAvb8j7zWo+K8dBlGWjOB1lwygYlx/bw/72byt7HsxDvMxuyv0oZzen5xXB9t9PcpOte9Vzd4kWt6frfS6LVoyeSDyeff37wf6wngXu2HY50qg8/2UJGqy2ZWjbtVZnFFbTyfJwER7sssknz1XkZv24GunA/W+nPR6Px+PxeDwej8fj8Xg8Hgj/Ab2yShOwqdmKAAAAAElFTkSuQmCC";
}
turn = turn + 1;
checkwinner(block)
}
}
let block="https://us.123rf.com/450wm/kritchanut/kritchanut1409/kritchanut140900060/31219816-white-gray-abstract-background-with-radial-gradient-effect.jpg?ver=6s"
function checkwinner(player){
let first=document.getElementById("first").src
let second=document.getElementById("second").src
let third=document.getElementById("third").src
let fourth=document.getElementById("fourth").src
let fifth=document.getElementById("fifth").src
let sixth=document.getElementById("sixth").src
let seventh=document.getElementById("seventh").src
let eight=document.getElementById("eight").src
let ninth=document.getElementById("ninth").src
if (first==second && second == third && first != block){
location.href="xwinner.html"
}
if (fourth==fifth && fifth == sixth && fourth != block){
location.href="xwinner.html"
}
if (seventh==eight && eight == ninth && seventh != block){
location.href="xwinner.html"
}
if (first==fourth && fourth == seventh && first != block){
location.href="xwinner.html"
}
if (second==fifth && fifth == eight && second != block){
location.href="xwinner.html"
}
if (third==sixth && sixth == ninth && third != block){
location.href="xwinner.html"
}
if (first==fifth && fifth == ninth && first != block){
location.href="xwinner.html"
}
if (third==fifth && fifth == seventh && third != block){
location.href="xwinner.html"
}
}
</script>
<div class="center">
<a href="index.html"><button>Restart</button></a>
</div>
</body>
</html>