Offer more computer difficulty levels than three

未关闭
#184 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
game-dev

调研方向

Read js/ai.js lines 13–17, then inspect the settings selector and saved-setting migration in js/config.js and js/main.js. Run npm test and review tests/unit/ai-strength.test.js to understand how strength is measured. Done when old easy, medium, and hard settings retain their strengths and every new level tests measurably stronger than the one below.

由索引模型根据 Issue 内容生成。

描述

enhancement help wanted severity: low

Summary

The computer has only three levels, and the gap between them is large. Offer a finer scale, for example 1 to 6, built from the knobs the engine already has: depth, thinking time, blunder rate and tolerance.

Where

  • js/ai.js:13-17 (AI_LEVELS: easy is depth 1 with 30% blunders, medium is depth 2, hard is depth 3 with a 1 s timed search)
  • The settings level selector, and the migration of the saved setting

Impact

Improving players get a step between medium and hard, and beginners get something gentler than easy. Stronger levels depend on a faster move generator, which is tracked separately (move generation dominates search).

Suggested fix

Turn AI_LEVELS into a numbered scale. Map today's easy, medium and hard to three of its steps, so saved settings keep their meaning. Add the new steps around them.

Open question: should this wait for #160 (a record of results against the computer), which could suggest a level?

Acceptance criteria

  • Saved settings of easy, medium and hard still load as the same strength.
  • Each level plays measurably stronger than the one below it in the existing ai-strength tests.

Getting started

  • Relevant files: js/ai.js, js/config.js, js/main.js (settings), tests/unit/ai-strength.test.js
  • How to run tests: npm test

Filed by repo-audit/full-audit at 01c6a35. Severity: low. Effort: S. audit-key: enhancement|js/ai.js|AI_LEVELS

主要语言
JavaScript
星标
4
派生
2
平均合并
22 小时 16 分钟
30 天内合并 PR
9

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/Static_Chess 的其他 Issue

查看 TMHSDigital/Static_Chess 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。