feat(classic-games): 新增 Mini Treblecross 小游戏#1221
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: b07049b293
ℹ️ 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".
| if (owner === "H") { | ||
| locked = true; | ||
| setMessage("AI 思考中..."); | ||
| setTimeout(playComputerTurn, 420); |
There was a problem hiding this comment.
Cancel pending AI turns when restarting
When the player clicks 重开 during the 420 ms AI-thinking window, this timeout is still queued; startGame() resets gameOver to false, so the old playComputerTurn runs against the fresh board and lets the AI place an unexpected first move. Repeating quick reset/move cycles can also leave multiple stale AI turns queued for the new game, so the reset button does not reliably start from an empty player-to-move state.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260717-2224-treblecross-lite.htmlValidation
startGame、emptyCells、hasTriple、wouldWin、dangerScore、chooseAiMove、placeMark、chooseCell、playComputerTurn、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260717-2224-treblecross-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260717-222645-42664Commit
09b7a3a20fe20053d39e36ce8da4cddbad5d2e04b07049b2932ba718c3ab1523c35166d73d0948ff