Skip to content

[Stretch] Undo/replay system #28

Description

@bh2smith

Summary

Immutable state history enabling undo (one step back) for solitaire games, and full replay for post-game review.

Tasks

  • Each game's state mutations push a snapshot onto a history: GameState[] stack
  • undo() pops the last state and re-renders (only available in Golf and Pyramid by default)
  • replay() steps through history array at configurable speed (500ms/step)
  • UI: 'Undo' button in action area during solitaire games; 'Replay' button on GAME_OVER
  • History is session-only (not persisted); cleared on new game

Notes

  • Opt-in per game: Golf ✓, Pyramid ✓, Blackjack ✗ (would break betting integrity), Gin ✗ (competitive), Hearts ✗
  • Memory: 13 tricks × 4 players = 52 state snapshots per Hearts round — acceptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    archShared architecturepriority: P5Stretch / optionalstretchNice-to-have / later

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions