Time Travel Debugging: Why Immutable State is a Superpower

In ch5, we built a recursive game loop that threads state through every turn. Each call to game_loop/1 receives a complete, immutable game state and produces a new one. We treated this as an implementation detail — a way to avoid mutable variables. But there&rsquo;s something deeper going on. Because Elixir never mutates data, every game state that ever existed is still a valid, self-contained…