Spielerando

Undo brings back the wrong board or changes old moves too

You press undo and the board jumps to a state you never had, or fixing the present quietly rewrites the past. The cause hides in how the saved states were copied. This entry gives your AI a checker that shows exactly where the copies are tied together.

Why this works

A saved state only protects the past if nothing inside it is shared with the present. Checking for shared parts finds the fault directly, instead of guessing from the symptom that appears many moves later.

When not to use it

Skip it when your game stores moves as small commands and replays them backwards; then there are no saved boards to share. Use the replay approach for long games with big boards.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 34 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Undo brings back the wrong board or changes old moves too" (read_entry undo-restores-wrong-board-shared-copies) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP