Keep a record of results against the computer

Aberta
#160 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
66/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript
Domínio
data, full-stack

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
JavaScript
Estrelas
4
Forks
2
Merge médio
22h 16min
PRs com merge (30d)
9

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Static_Chess

Todas as issues de TMHSDigital/Static_Chess

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.