Each cell of the grid is a strategy pair (row player × column player); its pillar height is the row player's payoff, its color intensity the column player's. Two token agents repeatedly play the game, each round choosing a strategy per their mode and moving to the corresponding cell. A cell glows when both agents keep returning to it — a Nash equilibrium, where neither player can improve their payoff by unilaterally switching strategy.
Nash equilibrium: for strategy pair (s₁*, s₂*),
u₁(s₁*, s₂*) ≥ u₁(s₁, s₂*) ∀ s₁
u₂(s₁*, s₂*) ≥ u₂(s₁*, s₂) ∀ s₂
Best-response dynamics: sᵢ(t+1) = argmax_sᵢ uᵢ(sᵢ, s₋ᵢ(t))
- Game preset — switches the payoff matrix: Prisoner's Dilemma (defection dominant), Stag Hunt (coordination game, two equilibria), Chicken (anti-coordination).
- Strategy mode — Tit-for-Tat mirrors the opponent's last move; Best-Response always jumps to the payoff-maximizing reply; Random picks uniformly.
- Play speed / Step / Auto-play — controls how the repeated game advances, round by round.
Repeated Prisoner's Dilemma with Tit-for-Tat strategies is the classic explanation economists use for why cooperation can emerge among self-interested firms or nations without central enforcement.