diff --git a/.gitignore b/.gitignore index 3ed122d..f5be4a5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ node_modules .DS_Store Thumbs.db .vscode +*.code-workspace # Env .env diff --git a/src/lib/stores/game.svelte.ts b/src/lib/stores/game.svelte.ts index c1c0b67..0f17a1e 100644 --- a/src/lib/stores/game.svelte.ts +++ b/src/lib/stores/game.svelte.ts @@ -29,7 +29,7 @@ export const game = { get isInCheck() { return chess.inCheck(); }, get result() { return storedResult ?? gameResult(chess); }, get status() { return status; }, - get moveCount() { return chess.history().length; }, + get moveCount() { return Math.ceil(chess.history().length / 2); }, get whiteHandle() { return whiteHandle; }, get blackHandle() { return blackHandle; }, get whiteDid() { return whiteDid; },