Skip to content

Keep a record of results against the computer #160

Open

Description

@TMHSDigital

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

Activity

  1. added
    enhancement
    help wanted
    severity: low
    on Nov 17, 2026
  2. Aanandan-T-Ma commented on Nov 18, 2026

    @Aanandan-T-Ma

    Hi @TMHSDigital , I would like to try contributing to this issue. Let me know if anyone else is working on this, or I can start.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions