feat(classic-games): 新增 Mini Pah Tum 小游戏#1219
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: 78b799850f
ℹ️ 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".
| setTimeout(() => { | ||
| placePiece(chooseAiMove(), "A"); | ||
| locked = false; |
There was a problem hiding this comment.
Cancel pending AI moves when resetting
If the player presses 重开 during the 450ms AI delay, startGame() resets the board but this timeout still runs and places an AI piece into the fresh game, so a new game can start with a phantom AI move; repeated resets can also queue multiple stale AI moves. Store and clear the timeout on reset, or guard the callback with a game-generation token before applying the AI move.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260717-2123-pah-tum-lite.htmlValidation
startGame、linesThrough、scorePlacement、chooseAiMove、placePiece、chooseCell、finishGame、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260717-2123-pah-tum-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260717-212737-34455Commit
06f976e1db0988b8de7318f4534e5225e0e06c8778b799850fec8de4ae8e519d6d32fa7e22e358d8