feat(classic-games): 新增 Mini Epaminondas 小游戏#1237
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 023f38fd45
ℹ️ 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".
| for (const [captureRow, captureCol] of move.captures) { | ||
| board[captureRow][captureCol] = ""; | ||
| } | ||
| for (let index = move.phalanx.length - 1; index >= 0; index -= 1) { |
There was a problem hiding this comment.
Process phalanx moves from the front
When a selected phalanx contains more than one piece, this reverse loop moves the rear piece into the front piece's square and then the next iteration clears that same square, so ordinary multi-piece slides delete pieces. For example, red pieces at rows 5 and 4 moving north into an empty row 3 leave only the row-3 piece instead of preserving both pieces, which corrupts counts and win checks for both player and AI moves.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260718-0624-epaminondas-lite.htmlValidation
freshBoard、phalanxCells、enemyLine、legalMovesFor、allLegalMoves、applyMove、chooseAiMove、playComputerTurn、checkGame、handleCell、renderBoard、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260718-0624-epaminondas-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260718-062843-80213Commit
5a078566d420f308e1a8a426a29290f9dc6cbd20023f38fd45f1b2b5d978d0ac1b563af18c27cb0d