feat(classic-games): 新增 Mini Dawson's Kayles 小游戏#1226
Conversation
Made-with: Cursor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b9d976a2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| locked = true; | ||
| setMessage("AI is choosing a pin..."); | ||
| render(); | ||
| window.setTimeout(runAiTurn, 260); |
There was a problem hiding this comment.
Cancel stale AI timeouts on reset
Because this timeout is not stored/cancelled or tied to a game generation, pressing New Game during the 260 ms AI delay resets the board while the old callback still runs against the fresh state. In that scenario the AI immediately makes a move in the new game, or interleaves with the player's first move, corrupting the reset game; clear the pending timeout or ignore stale callbacks when startGame() runs.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260718-0054-dawsons-kayles-lite.htmlValidation
startGame、legalMoves、applyMove、chooseCell、runAiTurn、chooseAiMove、scoreMove、openRuns、finishIfNoMoves、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260718-0054-dawsons-kayles-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260718-005909-57726Commit
7b045891952926896b1c576bdb1fbbe42ffb57675b9d976a2a0538b4b505886cb06a5968ca2b5c44