feat(classic-games): 新增 Mini N-Queens 小游戏#1236
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8944825286
ℹ️ 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 (let row = 0; row < size; row += 1) { | ||
| const rowHasQueen = [...queens].some((key) => parseKey(key)[0] === row); | ||
| if (!rowHasQueen) { | ||
| queens.add(keyOf(row, solution[row])); |
There was a problem hiding this comment.
Cap hint placements at six queens
When the board already contains six queens but they are not one per row, Hint remains enabled because the puzzle is unsolved; clicking it finds an empty row and adds another queen here, bypassing the queens.size < size guard used by manual placement. This lets the UI reach states like 7/6 queens and makes the puzzle impossible to complete until the player manually removes extra pieces.
Useful? React with 👍 / 👎.
Summary
project/classic-games/20260718-0554-n-queens-lite.htmlValidation
resetGame、toggleQueen、conflictsFor、boardStats、placeHint、renderBoard、render、addEventListenernew Function(...)git diff --check -- project/classic-games/20260718-0554-n-queens-lite.htmlAudit
run-audit.shOVERALL_EXIT=0/tmp/git-commit-audit-20260718-055928-78196Commit
0027cc5ed3b29a2011e3a08b5bc180290775ce128944825286392f5a6f4519c35050eb02e191bac1