feat(classic-games): 新增 Mini Dodgem 小游戏#1224
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: 4ced43ea79
ℹ️ 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".
| return; | ||
| } | ||
| if (selected === null) return; | ||
| const move = legalMoves(selected, "B").find((candidate) => candidate.to === index); |
There was a problem hiding this comment.
Allow blue cars to take exit moves
When a selected blue car is on the right edge, legalMoves returns { to: "exit" }, but the player can only click board cells and this lookup only matches numeric index values. As a result the blue exit move is never selectable or rendered, so blue cars cannot score/leave the board and the game can get stuck when the only legal blue move is exiting, while the red AI can still exit normally.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260717-2354-dodgem-lite.htmlValidation
startGame、legalMoves、allMoves、applyMove、chooseCell、runAiTurn、chooseAiMove、scoreRedMove、checkGame、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260717-2354-dodgem-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260717-235846-51664Commit
6fb58ffcb23327c8725c742ed6031a69d913d7f24ced43ea79e5af8bdb0753945ee62408f45b2954