Keep a record of results against the computer

Đang mở
#160 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
66/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
data, full-stack

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
4
Fork
2
Merge trung bình
22 giờ 16 phút
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/Static_Chess

Tất cả issue của TMHSDigital/Static_Chess

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.