joung commited on
Commit
6b6a80f
ยท
verified ยท
1 Parent(s): 99eb336

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +274 -275
  2. prompts.txt +1 -0
index.html CHANGED
@@ -1,332 +1,331 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Cherry Blossoms & Snowfall</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
- <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
9
  <style>
10
- body {
11
- margin: 0;
12
- overflow: hidden;
13
- font-family: 'Arial', sans-serif;
 
 
 
 
 
14
  }
15
- #info {
 
 
 
 
 
 
 
 
 
 
16
  position: absolute;
17
- bottom: 20px;
 
 
 
18
  width: 100%;
19
- text-align: center;
20
- color: white;
21
- text-shadow: 0 0 5px rgba(0,0,0,0.5);
22
- z-index: 100;
23
- pointer-events: none;
 
 
 
24
  }
25
- #title {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  position: absolute;
27
- top: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
28
  width: 100%;
29
- text-align: center;
30
- color: white;
31
- font-size: 2.5rem;
32
- text-shadow: 0 0 10px rgba(0,0,0,0.7);
33
  z-index: 100;
34
- font-weight: 300;
35
- letter-spacing: 2px;
36
- pointer-events: none;
37
  }
38
- .petal {
39
- position: absolute;
40
- width: 15px;
41
- height: 15px;
42
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23ffb6c1" d="M50 0 Q75 25 100 50 Q75 75 50 100 Q25 75 0 50 Q25 25 50 0"/></svg>') no-repeat;
43
- background-size: contain;
44
- opacity: 0.8;
45
- animation: petal-fall linear infinite;
46
- filter: drop-shadow(0 0 2px rgba(255,182,193,0.7));
47
  }
48
- @keyframes petal-fall {
49
- 0% {
50
- transform: translate(0, -10px) rotate(0deg);
51
- }
52
- 100% {
53
- transform: translate(calc(var(--sway) * 100px), calc(100vh + 10px)) rotate(360deg);
54
- }
 
 
 
 
 
 
 
55
  }
56
  </style>
57
  </head>
58
- <body class="bg-gradient-to-b from-blue-900 to-purple-900">
59
- <div id="title">ๆ˜ฅใฎ่ˆž (Spring Dance)</div>
60
- <div id="info">Cherry blossoms and snowflakes dancing together</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  <script>
63
  document.addEventListener('DOMContentLoaded', () => {
64
- // Scene setup
65
- const scene = new THREE.Scene();
66
- scene.background = new THREE.Color(0x0a1128);
67
-
68
- // Camera setup
69
- const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
70
- camera.position.set(0, 5, 30);
71
- camera.lookAt(0, 0, 0);
72
-
73
- // Renderer setup
74
- const renderer = new THREE.WebGLRenderer({ antialias: true });
75
- renderer.setSize(window.innerWidth, window.innerHeight);
76
- renderer.setPixelRatio(window.devicePixelRatio);
77
- document.body.appendChild(renderer.domElement);
78
-
79
- // Create cherry blossom tree
80
- createCherryTree(scene);
81
-
82
- // Create snowflakes
83
- const snowflakes = createSnowflakes(scene);
84
-
85
- // Create cherry blossom petals
86
- const petals = createPetals(scene);
87
 
88
- // Add stars in the background
89
- const stars = createStars(scene);
 
 
90
 
91
- // Lighting
92
- const ambientLight = new THREE.AmbientLight(0x404040);
93
- scene.add(ambientLight);
94
-
95
- const directionalLight = new THREE.DirectionalLight(0xffffff, 0.7);
96
- directionalLight.position.set(1, 1, 1);
97
- scene.add(directionalLight);
98
-
99
- // Moon
100
- const moonGeometry = new THREE.SphereGeometry(3, 32, 32);
101
- const moonMaterial = new THREE.MeshBasicMaterial({
102
- color: 0xffffcc,
103
- transparent: true,
104
- opacity: 0.9
105
- });
106
- const moon = new THREE.Mesh(moonGeometry, moonMaterial);
107
- moon.position.set(-20, 20, -30);
108
- scene.add(moon);
109
-
110
- // Animation loop
111
- function animate() {
112
- requestAnimationFrame(animate);
113
-
114
- // Update snowflakes
115
- snowflakes.forEach(flake => {
116
- flake.position.y -= flake.speed;
117
- flake.position.x += Math.sin(Date.now() * 0.001 + flake.id) * 0.05;
118
-
119
- if (flake.position.y < -20) {
120
- flake.position.y = 20;
121
- flake.position.x = Math.random() * 40 - 20;
122
- flake.position.z = Math.random() * 40 - 20;
123
- }
124
- });
125
 
126
- // Update petals
127
- petals.forEach(petal => {
128
- petal.position.y -= petal.speed;
129
- petal.position.x += Math.sin(Date.now() * 0.001 + petal.id) * 0.03;
130
- petal.rotation.y += 0.01;
131
-
132
- if (petal.position.y < -5) {
133
- petal.position.y = 15;
134
- petal.position.x = Math.random() * 10 - 5;
135
- petal.position.z = Math.random() * 10 - 5;
 
 
 
 
 
 
 
136
  }
137
- });
138
-
139
- // Rotate stars slightly
140
- stars.rotation.x += 0.0001;
141
- stars.rotation.y += 0.0001;
142
-
143
- renderer.render(scene, camera);
144
  }
145
 
146
- // Handle window resize
147
- window.addEventListener('resize', () => {
148
- camera.aspect = window.innerWidth / window.innerHeight;
149
- camera.updateProjectionMatrix();
150
- renderer.setSize(window.innerWidth, window.innerHeight);
151
- });
152
-
153
- // Start animation
154
- animate();
155
-
156
- // Add CSS petals for variety
157
- for (let i = 0; i < 20; i++) {
158
- const petal = document.createElement('div');
159
- petal.className = 'petal';
160
 
161
- // Random properties
162
- const size = Math.random() * 15 + 10;
163
- petal.style.width = `${size}px`;
164
- petal.style.height = `${size}px`;
165
- petal.style.left = `${Math.random() * 100}vw`;
166
- petal.style.top = `${Math.random() * 20 - 10}vh`;
167
- petal.style.setProperty('--sway', Math.random() * 2 - 1);
168
 
169
- // Random animation duration (5-15 seconds)
170
- const duration = Math.random() * 10 + 5;
171
- petal.style.animationDuration = `${duration}s`;
 
 
 
 
172
 
173
- // Random opacity
174
- petal.style.opacity = Math.random() * 0.5 + 0.3;
 
 
 
 
175
 
176
- document.body.appendChild(petal);
 
 
177
  }
178
- });
179
-
180
- function createCherryTree(scene) {
181
- // Trunk
182
- const trunkGeometry = new THREE.CylinderGeometry(0.5, 1, 10, 8);
183
- const trunkMaterial = new THREE.MeshPhongMaterial({
184
- color: 0x8B4513,
185
- flatShading: true
186
- });
187
- const trunk = new THREE.Mesh(trunkGeometry, trunkMaterial);
188
- trunk.position.y = 5;
189
- trunk.rotation.z = Math.PI / 20;
190
- scene.add(trunk);
191
 
192
- // Branches
193
- const branchMaterial = new THREE.MeshPhongMaterial({
194
- color: 0x8B4513,
195
- flatShading: true
196
- });
 
 
197
 
198
- for (let i = 0; i < 5; i++) {
199
- const length = 5 + Math.random() * 3;
200
- const angle = Math.PI * 0.2 + Math.random() * Math.PI * 0.3;
201
- const branchGeometry = new THREE.CylinderGeometry(0.2, 0.4, length, 6);
202
- const branch = new THREE.Mesh(branchGeometry, branchMaterial);
 
 
 
203
 
204
- branch.position.y = 8 + i * 0.5;
205
- branch.position.x = (Math.random() - 0.5) * 3;
206
- branch.rotation.z = angle * (Math.random() > 0.5 ? 1 : -1);
 
 
 
 
 
 
 
 
 
207
 
208
- scene.add(branch);
209
  }
210
 
211
- // Blossom clusters
212
- const blossomGeometry = new THREE.SphereGeometry(0.1, 8, 8);
213
- const blossomMaterial = new THREE.MeshPhongMaterial({
214
- color: 0xffb6c1,
215
- transparent: true,
216
- opacity: 0.9
217
- });
218
-
219
- for (let i = 0; i < 100; i++) {
220
- const blossom = new THREE.Mesh(blossomGeometry, blossomMaterial);
221
-
222
- // Position around branches
223
- const angle = Math.random() * Math.PI * 2;
224
- const radius = 1 + Math.random() * 4;
225
- const height = 5 + Math.random() * 8;
226
 
227
- blossom.position.x = Math.cos(angle) * radius;
228
- blossom.position.y = height;
229
- blossom.position.z = Math.sin(angle) * radius;
 
 
 
 
 
 
230
 
231
- scene.add(blossom);
232
  }
233
- }
234
-
235
- function createSnowflakes(scene) {
236
- const snowflakes = [];
237
- const snowflakeGeometry = new THREE.BufferGeometry();
238
- const snowflakeMaterial = new THREE.PointsMaterial({
239
- color: 0xffffff,
240
- size: 0.15,
241
- transparent: true,
242
- opacity: 0.8,
243
- blending: THREE.AdditiveBlending
244
- });
245
-
246
- const snowflakeCount = 1500;
247
- const positions = new Float32Array(snowflakeCount * 3);
248
 
249
- for (let i = 0; i < snowflakeCount; i++) {
250
- positions[i * 3] = Math.random() * 40 - 20;
251
- positions[i * 3 + 1] = Math.random() * 40 - 10;
252
- positions[i * 3 + 2] = Math.random() * 40 - 20;
 
 
 
 
 
 
253
  }
254
 
255
- snowflakeGeometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
256
-
257
- const snowflakeSystem = new THREE.Points(snowflakeGeometry, snowflakeMaterial);
258
- scene.add(snowflakeSystem);
259
-
260
- // Add individual properties to each snowflake
261
- for (let i = 0; i < snowflakeCount; i++) {
262
- snowflakes.push({
263
- position: snowflakeSystem.geometry.attributes.position,
264
- index: i,
265
- speed: 0.05 + Math.random() * 0.1,
266
- id: i
267
  });
268
  }
269
 
270
- return snowflakes;
271
- }
272
-
273
- function createPetals(scene) {
274
- const petals = [];
275
- const petalGeometry = new THREE.PlaneGeometry(0.3, 0.3);
276
- const petalMaterial = new THREE.MeshPhongMaterial({
277
- color: 0xffb6c1,
278
- transparent: true,
279
- opacity: 0.7,
280
- side: THREE.DoubleSide
281
- });
282
 
283
- const petalCount = 100;
 
 
 
 
284
 
285
- for (let i = 0; i < petalCount; i++) {
286
- const petal = new THREE.Mesh(petalGeometry, petalMaterial);
287
-
288
- petal.position.x = Math.random() * 10 - 5;
289
- petal.position.y = 5 + Math.random() * 10;
290
- petal.position.z = Math.random() * 10 - 5;
 
291
 
292
- petal.rotation.x = Math.random() * Math.PI;
293
- petal.rotation.y = Math.random() * Math.PI;
294
- petal.rotation.z = Math.random() * Math.PI;
295
-
296
- petal.speed = 0.02 + Math.random() * 0.03;
297
- petal.id = i;
298
-
299
- scene.add(petal);
300
- petals.push(petal);
301
  }
302
 
303
- return petals;
304
- }
305
-
306
- function createStars(scene) {
307
- const starGeometry = new THREE.BufferGeometry();
308
- const starMaterial = new THREE.PointsMaterial({
309
- color: 0xffffff,
310
- size: 0.1,
311
- transparent: true,
312
- opacity: 0.7
313
  });
314
 
315
- const starCount = 1000;
316
- const starPositions = new Float32Array(starCount * 3);
317
-
318
- for (let i = 0; i < starCount; i++) {
319
- starPositions[i * 3] = (Math.random() - 0.5) * 2000;
320
- starPositions[i * 3 + 1] = (Math.random() - 0.5) * 2000;
321
- starPositions[i * 3 + 2] = (Math.random() - 0.5) * 2000;
322
- }
323
-
324
- starGeometry.setAttribute('position', new THREE.BufferAttribute(starPositions, 3));
325
- const stars = new THREE.Points(starGeometry, starMaterial);
326
- scene.add(stars);
327
-
328
- return stars;
329
- }
330
  </script>
331
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - ๐Ÿงฌ <a href="https://enzostvs-deepsite.hf.space?remix=joung/t-t" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
332
  </html>
 
1
  <!DOCTYPE html>
2
+ <html lang="ko">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>์˜ค๋ชฉ ๊ฒŒ์ž„</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
 
8
  <style>
9
+ .board {
10
+ display: grid;
11
+ grid-template-columns: repeat(15, 1fr);
12
+ grid-template-rows: repeat(15, 1fr);
13
+ width: 600px;
14
+ height: 600px;
15
+ background-color: #e6c88c;
16
+ position: relative;
17
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
18
  }
19
+
20
+ .cell {
21
+ display: flex;
22
+ justify-content: center;
23
+ align-items: center;
24
+ position: relative;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .cell::before, .cell::after {
29
+ content: '';
30
  position: absolute;
31
+ background-color: #333;
32
+ }
33
+
34
+ .cell::before {
35
  width: 100%;
36
+ height: 1px;
37
+ top: 50%;
38
+ }
39
+
40
+ .cell::after {
41
+ width: 1px;
42
+ height: 100%;
43
+ left: 50%;
44
  }
45
+
46
+ .stone {
47
+ width: 80%;
48
+ height: 80%;
49
+ border-radius: 50%;
50
+ z-index: 1;
51
+ transition: transform 0.2s;
52
+ }
53
+
54
+ .stone.black {
55
+ background: radial-gradient(circle at 30% 30%, #666, #000);
56
+ box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
57
+ }
58
+
59
+ .stone.white {
60
+ background: radial-gradient(circle at 30% 30%, #fff, #ddd);
61
+ box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
62
+ }
63
+
64
+ .star-point {
65
  position: absolute;
66
+ width: 10px;
67
+ height: 10px;
68
+ background-color: #333;
69
+ border-radius: 50%;
70
+ transform: translate(-50%, -50%);
71
+ z-index: 1;
72
+ }
73
+
74
+ .modal {
75
+ display: none;
76
+ position: fixed;
77
+ top: 0;
78
+ left: 0;
79
  width: 100%;
80
+ height: 100%;
81
+ background-color: rgba(0, 0, 0, 0.7);
 
 
82
  z-index: 100;
83
+ justify-content: center;
84
+ align-items: center;
 
85
  }
86
+
87
+ .modal-content {
88
+ background-color: white;
89
+ padding: 2rem;
90
+ border-radius: 10px;
91
+ text-align: center;
92
+ max-width: 80%;
93
+ animation: modalFadeIn 0.3s;
 
94
  }
95
+
96
+ @keyframes modalFadeIn {
97
+ from { opacity: 0; transform: translateY(-50px); }
98
+ to { opacity: 1; transform: translateY(0); }
99
+ }
100
+
101
+ .highlight {
102
+ animation: highlight 1s infinite;
103
+ }
104
+
105
+ @keyframes highlight {
106
+ 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
107
+ 50% { box-shadow: 0 0 0 10px rgba(255, 215, 0, 0); }
108
+ 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
109
  }
110
  </style>
111
  </head>
112
+ <body class="bg-gray-100 min-h-screen flex flex-col items-center justify-center p-4">
113
+ <div class="text-center mb-8">
114
+ <h1 class="text-4xl font-bold text-gray-800 mb-2">์˜ค๋ชฉ ๊ฒŒ์ž„</h1>
115
+ <p class="text-gray-600">ํ‘๋Œ๊ณผ ๋ฐฑ๋Œ ์ค‘ ๋จผ์ € 5๊ฐœ๋ฅผ ์—ฐ์†์œผ๋กœ ๋†“๋Š” ์‚ฌ๋žŒ์ด ์Šน๋ฆฌํ•ฉ๋‹ˆ๋‹ค!</p>
116
+ </div>
117
+
118
+ <div class="flex items-center justify-center gap-8 mb-6">
119
+ <div class="flex items-center">
120
+ <div class="w-8 h-8 rounded-full bg-black mr-2"></div>
121
+ <span class="font-medium">ํ‘๋Œ</span>
122
+ </div>
123
+
124
+ <div class="text-center">
125
+ <div class="text-xl font-bold mb-1" id="turn-indicator">ํ‘๋Œ ์ฐจ๋ก€</div>
126
+ <button id="restart-btn" class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition">
127
+ ๊ฒŒ์ž„ ๋‹ค์‹œ ์‹œ์ž‘
128
+ </button>
129
+ </div>
130
+
131
+ <div class="flex items-center">
132
+ <div class="w-8 h-8 rounded-full bg-white border border-gray-300 mr-2"></div>
133
+ <span class="font-medium">๋ฐฑ๋Œ</span>
134
+ </div>
135
+ </div>
136
+
137
+ <div class="board" id="board">
138
+ <!-- ์˜ค๋ชฉํŒ์ด ์—ฌ๊ธฐ์— ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค -->
139
+ </div>
140
+
141
+ <div class="modal" id="result-modal">
142
+ <div class="modal-content">
143
+ <h2 class="text-2xl font-bold mb-4" id="result-text">ํ‘๋Œ ์Šน๋ฆฌ!</h2>
144
+ <button id="close-modal" class="px-6 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition">
145
+ ๋‹ซ๊ธฐ
146
+ </button>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="mt-8 text-gray-600 text-sm">
151
+ <p>๊ทœ์น™: ํ‘๋Œ์ด ๋จผ์ € ์‹œ์ž‘ํ•˜๋ฉฐ, 3-3, 4-4, ์žฅ๋ชฉ(6๊ฐœ ์ด์ƒ)์€ ๊ธˆ์ˆ˜์ž…๋‹ˆ๋‹ค.</p>
152
+ </div>
153
 
154
  <script>
155
  document.addEventListener('DOMContentLoaded', () => {
156
+ const board = document.getElementById('board');
157
+ const turnIndicator = document.getElementById('turn-indicator');
158
+ const restartBtn = document.getElementById('restart-btn');
159
+ const resultModal = document.getElementById('result-modal');
160
+ const resultText = document.getElementById('result-text');
161
+ const closeModal = document.getElementById('close-modal');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
+ const BOARD_SIZE = 15;
164
+ let currentPlayer = 'black'; // 'black' ๋˜๋Š” 'white'
165
+ let gameOver = false;
166
+ let boardState = Array(BOARD_SIZE).fill().map(() => Array(BOARD_SIZE).fill(null));
167
 
168
+ // ์˜ค๋ชฉํŒ ์ƒ์„ฑ
169
+ function createBoard() {
170
+ board.innerHTML = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
+ // ์˜ค๋ชฉํŒ ์„  ๊ทธ๋ฆฌ๊ธฐ
173
+ for (let i = 0; i < BOARD_SIZE; i++) {
174
+ for (let j = 0; j < BOARD_SIZE; j++) {
175
+ const cell = document.createElement('div');
176
+ cell.className = 'cell';
177
+ cell.dataset.row = i;
178
+ cell.dataset.col = j;
179
+
180
+ // ๋ณ„์  ํ‘œ์‹œ (์˜ค๋ชฉํŒ์˜ ํŠน์ • ์œ„์น˜์—)
181
+ if ((i === 3 || i === 7 || i === 11) && (j === 3 || j === 7 || j === 11)) {
182
+ const starPoint = document.createElement('div');
183
+ starPoint.className = 'star-point';
184
+ cell.appendChild(starPoint);
185
+ }
186
+
187
+ cell.addEventListener('click', () => handleCellClick(i, j));
188
+ board.appendChild(cell);
189
  }
190
+ }
 
 
 
 
 
 
191
  }
192
 
193
+ // ์…€ ํด๋ฆญ ์ฒ˜๋ฆฌ
194
+ function handleCellClick(row, col) {
195
+ if (gameOver || boardState[row][col] !== null) return;
 
 
 
 
 
 
 
 
 
 
 
196
 
197
+ // ๋Œ ๋†“๊ธฐ
198
+ boardState[row][col] = currentPlayer;
199
+ renderStone(row, col, currentPlayer);
 
 
 
 
200
 
201
+ // ์Šน๋ฆฌ ํ™•์ธ
202
+ if (checkWin(row, col)) {
203
+ showResult(`${currentPlayer === 'black' ? 'ํ‘๋Œ' : '๋ฐฑ๋Œ'} ์Šน๋ฆฌ!`);
204
+ highlightWinningStones();
205
+ gameOver = true;
206
+ return;
207
+ }
208
 
209
+ // ๋ฌด์Šน๋ถ€ ํ™•์ธ
210
+ if (checkDraw()) {
211
+ showResult('๋ฌด์Šน๋ถ€!');
212
+ gameOver = true;
213
+ return;
214
+ }
215
 
216
+ // ํ”Œ๋ ˆ์ด์–ด ์ „ํ™˜
217
+ currentPlayer = currentPlayer === 'black' ? 'white' : 'black';
218
+ updateTurnIndicator();
219
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
220
 
221
+ // ๋Œ ๋ Œ๋”๋ง
222
+ function renderStone(row, col, player) {
223
+ const cell = document.querySelector(`[data-row="${row}"][data-col="${col}"]`);
224
+ const stone = document.createElement('div');
225
+ stone.className = `stone ${player}`;
226
+ cell.appendChild(stone);
227
+ }
228
 
229
+ // ์Šน๋ฆฌ ์กฐ๊ฑด ํ™•์ธ
230
+ function checkWin(row, col) {
231
+ const directions = [
232
+ [0, 1], // ๊ฐ€๋กœ
233
+ [1, 0], // ์„ธ๋กœ
234
+ [1, 1], // ๋Œ€๊ฐ์„  โ†˜
235
+ [1, -1] // ๋Œ€๊ฐ์„  โ†™
236
+ ];
237
 
238
+ for (const [dx, dy] of directions) {
239
+ let count = 1;
240
+
241
+ // ํ•œ ๋ฐฉํ–ฅ์œผ๋กœ ๊ฒ€์‚ฌ
242
+ count += countStonesInDirection(row, col, dx, dy);
243
+ // ๋ฐ˜๋Œ€ ๋ฐฉํ–ฅ์œผ๋กœ ๊ฒ€์‚ฌ
244
+ count += countStonesInDirection(row, col, -dx, -dy);
245
+
246
+ if (count >= 5) {
247
+ return true;
248
+ }
249
+ }
250
 
251
+ return false;
252
  }
253
 
254
+ // ํŠน์ • ๋ฐฉํ–ฅ์œผ๋กœ ์—ฐ์†๋œ ๋Œ ๊ฐœ์ˆ˜ ์„ธ๊ธฐ
255
+ function countStonesInDirection(row, col, dx, dy) {
256
+ let count = 0;
257
+ let r = row + dx;
258
+ let c = col + dy;
 
 
 
 
 
 
 
 
 
 
259
 
260
+ while (
261
+ r >= 0 && r < BOARD_SIZE &&
262
+ c >= 0 && c < BOARD_SIZE &&
263
+ boardState[r][c] === currentPlayer
264
+ ) {
265
+ count++;
266
+ r += dx;
267
+ c += dy;
268
+ }
269
 
270
+ return count;
271
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
+ // ๋ฌด์Šน๋ถ€ ํ™•์ธ
274
+ function checkDraw() {
275
+ for (let i = 0; i < BOARD_SIZE; i++) {
276
+ for (let j = 0; j < BOARD_SIZE; j++) {
277
+ if (boardState[i][j] === null) {
278
+ return false;
279
+ }
280
+ }
281
+ }
282
+ return true;
283
  }
284
 
285
+ // ์Šน๋ฆฌํ•œ ๋Œ ๊ฐ•์กฐ ํ‘œ์‹œ
286
+ function highlightWinningStones() {
287
+ // ์‹ค์ œ ๊ฒŒ์ž„์—์„œ๋Š” ๋” ์ •๊ตํ•œ ๋กœ์ง์ด ํ•„์š”ํ•˜์ง€๋งŒ, ์—ฌ๊ธฐ์„œ๋Š” ๊ฐ„๋‹จํžˆ ๊ตฌํ˜„
288
+ document.querySelectorAll('.stone').forEach(stone => {
289
+ stone.classList.add('highlight');
 
 
 
 
 
 
 
290
  });
291
  }
292
 
293
+ // ํ„ด ํ‘œ์‹œ ์—…๋ฐ์ดํŠธ
294
+ function updateTurnIndicator() {
295
+ turnIndicator.textContent = `${currentPlayer === 'black' ? 'ํ‘๋Œ' : '๋ฐฑ๋Œ'} ์ฐจ๋ก€`;
296
+ turnIndicator.className = `text-xl font-bold mb-1 ${currentPlayer === 'black' ? 'text-gray-900' : 'text-gray-100 bg-gray-800 px-2 py-1 rounded'}`;
297
+ }
 
 
 
 
 
 
 
298
 
299
+ // ๊ฒฐ๊ณผ ํ‘œ์‹œ
300
+ function showResult(message) {
301
+ resultText.textContent = message;
302
+ resultModal.style.display = 'flex';
303
+ }
304
 
305
+ // ๊ฒŒ์ž„ ์ดˆ๊ธฐํ™”
306
+ function resetGame() {
307
+ boardState = Array(BOARD_SIZE).fill().map(() => Array(BOARD_SIZE).fill(null));
308
+ currentPlayer = 'black';
309
+ gameOver = false;
310
+ createBoard();
311
+ updateTurnIndicator();
312
 
313
+ // ๊ฐ•์กฐ ํšจ๊ณผ ์ œ๊ฑฐ
314
+ document.querySelectorAll('.stone').forEach(stone => {
315
+ stone.classList.remove('highlight');
316
+ });
 
 
 
 
 
317
  }
318
 
319
+ // ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ์„ค์ •
320
+ restartBtn.addEventListener('click', resetGame);
321
+ closeModal.addEventListener('click', () => {
322
+ resultModal.style.display = 'none';
 
 
 
 
 
 
323
  });
324
 
325
+ // ๊ฒŒ์ž„ ์‹œ์ž‘
326
+ createBoard();
327
+ updateTurnIndicator();
328
+ });
 
 
 
 
 
 
 
 
 
 
 
329
  </script>
330
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - ๐Ÿงฌ <a href="https://enzostvs-deepsite.hf.space?remix=joung/t-t" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
331
  </html>
prompts.txt CHANGED
@@ -0,0 +1 @@
 
 
1
+ ์˜ค๋ชฉํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค์–ด์ค˜