Keep a record of results against the computer

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
66/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript
领域
data, full-stack

调研方向

Read js/game-store.js, js/game.js, js/config.js, and index.html; trace how a computer game ends and how Settings renders existing game data. Check npm test and the relevant tests before implementing the counter, validation, reset, and summary. Done when computer game results update once per level and side, damaged saved stats are ignored, and the tests cover counting and validation; the Undo-and-replay and resumed-game questions need a decision.

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

描述

enhancement help wanted severity: low

Summary

Each past game stores its result and opponent, but nothing adds them up, so a player working up from easy to hard has no sense of progress. The archive keeps only 20 games, so totals need their own small record.

Where

  • js/game-store.js:48 (each entry stores result and opponent)
  • js/game-ui.js:545-554 (the list shows them per game only)

Proposal

Keep a small stats record in localStorage (new key in CONFIG.STORAGE_KEYS) with win/draw/loss per level and side, updated when a game against the computer ends. Show a one-line summary per level in Settings with a Reset button.

Who benefits

Players using the computer opponent to improve.

Open questions

  • Should games ended by Undo-and-replay or resumed from Play from here count?

Acceptance criteria

  • Finishing a game against the computer updates the right counter once
  • Reset clears it; a damaged stats record is ignored, not fatal
  • Tests for the counter and its validation

Getting started

  • Relevant files: js/game-store.js, js/game.js, js/config.js, index.html
  • How to run tests: npm ci && npm test

Filed by repo-audit/full-audit at 73cd279. Severity: low. Effort: S. audit-key: enhancement|js/game-store.js|stats

主要语言
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 摘要。