penis
This commit is contained in:
parent
9a99646954
commit
9f946701c8
10 changed files with 62 additions and 6 deletions
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
||||||
#Generated by Maven
|
#Generated by Maven
|
||||||
#Tue Feb 10 14:54:37 CET 2026
|
#Tue Feb 10 14:58:36 CET 2026
|
||||||
artifactId=ai-client
|
artifactId=ai-client
|
||||||
groupId=com.lona.tictactoe
|
groupId=com.lona.tictactoe
|
||||||
version=1.0-SNAPSHOT
|
version=1.0-SNAPSHOT
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
||||||
#Generated by Maven
|
#Generated by Maven
|
||||||
#Tue Feb 10 14:07:26 CET 2026
|
#Tue Feb 10 15:00:01 CET 2026
|
||||||
artifactId=client
|
artifactId=client
|
||||||
groupId=com.lona.tictactoe
|
groupId=com.lona.tictactoe
|
||||||
version=1.0-SNAPSHOT
|
version=1.0-SNAPSHOT
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -7,10 +7,29 @@ const joinInput = document.getElementById('join-code');
|
||||||
const displayCode = document.getElementById('display-code');
|
const displayCode = document.getElementById('display-code');
|
||||||
const turnStatus = document.getElementById('turn-status');
|
const turnStatus = document.getElementById('turn-status');
|
||||||
const leaveBtn = document.getElementById('leave-btn');
|
const leaveBtn = document.getElementById('leave-btn');
|
||||||
|
const surrenderBtn = document.getElementById('surrender-btn');
|
||||||
|
const cells = document.querySelectorAll('.cell');
|
||||||
|
|
||||||
// ... (other vars)
|
// Game State
|
||||||
|
let mySymbol = '';
|
||||||
|
let ws = null;
|
||||||
|
let currentCode = '';
|
||||||
|
|
||||||
// ...
|
function send(msg) {
|
||||||
|
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||||
|
ws.send(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event Listeners
|
||||||
|
createBtn.addEventListener('click', () => {
|
||||||
|
send('CREATE');
|
||||||
|
});
|
||||||
|
|
||||||
|
joinBtn.addEventListener('click', () => {
|
||||||
|
const code = joinInput.value.trim();
|
||||||
|
if (code) send(`JOIN ${code}`);
|
||||||
|
});
|
||||||
|
|
||||||
leaveBtn.addEventListener('click', () => {
|
leaveBtn.addEventListener('click', () => {
|
||||||
if (confirm('Are you sure you want to leave the lobby?')) {
|
if (confirm('Are you sure you want to leave the lobby?')) {
|
||||||
|
|
@ -25,6 +44,15 @@ surrenderBtn.addEventListener('click', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cells.forEach(cell => {
|
||||||
|
cell.addEventListener('click', () => {
|
||||||
|
if (!mySymbol) return;
|
||||||
|
const r = cell.dataset.r;
|
||||||
|
const c = cell.dataset.c;
|
||||||
|
send(`MOVE ${r} ${c}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
function handleMessage(msg) {
|
function handleMessage(msg) {
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,29 @@ const joinInput = document.getElementById('join-code');
|
||||||
const displayCode = document.getElementById('display-code');
|
const displayCode = document.getElementById('display-code');
|
||||||
const turnStatus = document.getElementById('turn-status');
|
const turnStatus = document.getElementById('turn-status');
|
||||||
const leaveBtn = document.getElementById('leave-btn');
|
const leaveBtn = document.getElementById('leave-btn');
|
||||||
|
const surrenderBtn = document.getElementById('surrender-btn');
|
||||||
|
const cells = document.querySelectorAll('.cell');
|
||||||
|
|
||||||
// ... (other vars)
|
// Game State
|
||||||
|
let mySymbol = '';
|
||||||
|
let ws = null;
|
||||||
|
let currentCode = '';
|
||||||
|
|
||||||
// ...
|
function send(msg) {
|
||||||
|
if (ws && ws.readyState === WebSocket.OPEN) {
|
||||||
|
ws.send(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event Listeners
|
||||||
|
createBtn.addEventListener('click', () => {
|
||||||
|
send('CREATE');
|
||||||
|
});
|
||||||
|
|
||||||
|
joinBtn.addEventListener('click', () => {
|
||||||
|
const code = joinInput.value.trim();
|
||||||
|
if (code) send(`JOIN ${code}`);
|
||||||
|
});
|
||||||
|
|
||||||
leaveBtn.addEventListener('click', () => {
|
leaveBtn.addEventListener('click', () => {
|
||||||
if (confirm('Are you sure you want to leave the lobby?')) {
|
if (confirm('Are you sure you want to leave the lobby?')) {
|
||||||
|
|
@ -25,6 +44,15 @@ surrenderBtn.addEventListener('click', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cells.forEach(cell => {
|
||||||
|
cell.addEventListener('click', () => {
|
||||||
|
if (!mySymbol) return;
|
||||||
|
const r = cell.dataset.r;
|
||||||
|
const c = cell.dataset.c;
|
||||||
|
send(`MOVE ${r} ${c}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
function handleMessage(msg) {
|
function handleMessage(msg) {
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue