Skip to content

feat(classic-games): 新增 Mini Euclid's Game 小游戏#1228

Open
wyf027 wants to merge 1 commit into
mainfrom
codex/classic-game-20260718-0154-euclid-game-lite
Open

feat(classic-games): 新增 Mini Euclid's Game 小游戏#1228
wyf027 wants to merge 1 commit into
mainfrom
codex/classic-game-20260718-0154-euclid-game-lite

Conversation

@wyf027

@wyf027 wyf027 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • 新增单文件 HTML + TailwindCSS 小游戏:Mini Euclid's Game
  • 文件路径:project/classic-games/20260718-0154-euclid-game-lite.html
  • 历史扫描显示 Euclid's Game / euclid-game-lite 未使用;Nim 类已出现过,但本次是不同规则的欧几里得数学博弈

Validation

  • 确认文件存在并包含完整 HTML 结构、TailwindCSS CDN 与可运行游戏逻辑
  • 通过关键标记检查:startGamelegalMovesForapplyMovechooseMoverunAiTurnchooseAiMovescoreMovefinishIfWonrenderaddEventListener
  • 通过内联脚本语法检查:new Function(...)
  • 通过 git diff --check -- project/classic-games/20260718-0154-euclid-game-lite.html

Audit

  • 审计脚本:run-audit.sh
  • 结果:OVERALL_EXIT=0
  • WARN:无
  • AUDIT_DIR:/tmp/git-commit-audit-20260718-015705-62217

Commit

  • Local commit: fe1cc0f2d8b3b8ae42bf3ddab8d488e52249bc01
  • Remote commit: 18fadd9fe53b5ce9b7948d81c5c9d7104654dcac

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18fadd9fe5

ℹ️ 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".

turnCount.textContent = moves.H + moves.A;
choices.innerHTML = "";

const legalMoves = legalMovesFor();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop rendering legal moves after a pile reaches zero

When either player makes a winning move, finishIfWon() sets done and immediately calls render(), but render() still calls legalMovesFor() with a pile value of 0. In that state low is 0, so Math.floor(high / low) becomes Infinity and Array.from({ length: Infinity }) throws a RangeError; the game crashes exactly when a user or AI wins instead of showing the final state. Guard this path before generating legal moves for completed games.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant