-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex3d.html
More file actions
51 lines (51 loc) · 2.91 KB
/
index3d.html
File metadata and controls
51 lines (51 loc) · 2.91 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Tic-Tac-Toe Solver (3D UI)</title>
<link rel="stylesheet" href="styles.css">
<!-- three.js CDN -->
<script src="https://cdn.jsdelivr.net/npm/three@0.153.0/build/three.min.js"></script>
</head>
<body>
<div class="container">
<h1>3D Tic-Tac-Toe Solver <span style="font-size:1rem; font-weight:normal;">(3D UI)</span></h1>
<div id="status3d" class="status3d-centered"></div>
<div class="controls">
<div id="preGameControls3d">
<label>Width: <input type="number" id="width3d" min="2" max="6" value="3"></label>
<label>Height: <input type="number" id="height3d" min="2" max="6" value="3"></label>
<label>Depth: <input type="number" id="depth3d" min="2" max="6" value="3"></label>
<label>Win Length: <input type="number" id="winLength3d" min="2" max="6" value="3"></label>
<button id="startBtn3d">Start Game</button>
</div>
<div id="inGameControls3d" style="display:none;">
<button id="restartBtn3d">Restart</button>
<button id="undoBtn3d">Undo</button>
<button id="aiBtn3d">AI Move</button>
<label>AI Depth: <input type="number" id="aiDepth3d" min="1" max="6" value="2"></label>
<button id="quitBtn3d">Quit Game</button>
</div>
</div>
<div id="board3dContainer" class="board3d-container" style="width: 90vw; height: 70vh;"></div>
<div class="instructions">
<h2>How to Play</h2>
<p><strong>Objective:</strong> Get the specified number of pieces in a row (default: 3) in any direction to win.</p>
<ul>
<li><strong>Start:</strong> Set board dimensions and win length, then click "Start Game"</li>
<li><strong>Make a Move:</strong> Click on any empty cell to place your piece (X or O)</li>
<li><strong>Rotate Board:</strong> Click and drag the polyhedron near the top-right corner to rotate the 3D view</li>
<li><strong>AI Move:</strong> Click "AI Move" to let the computer play for the current player</li>
<li><strong>AI Depth:</strong> Higher values (1-6) make the AI stronger but slower</li>
<li><strong>Undo:</strong> Take back the last move</li>
</ul>
<p><strong>Win Directions:</strong> You can win along any axis (X, Y, Z), any planar diagonal, or any 3D space diagonal.</p>
</div>
<div class="credits" style="margin-top: 2rem; text-align: center; font-size: 0.9rem; color: #666;">
Written by <a href="https://shak2000.github.io/" target="_blank" rel="noopener noreferrer">Shak Ragoler</a>
</div>
</div>
<script src="script3d.js"></script>
</body>
</html>