Move History
ZK Proof State
Start a new game to see ZK state
Strategic Position Values
Values derived from Petri net ODE simulation. Higher values indicate more strategic positions.
Win Patterns
Position Value Distribution
How It Works: go-pflow Concepts
This simulator demonstrates key concepts from the go-pflow library for modeling state machines and strategic analysis using Petri nets.
Each cell on the 3x3 board is modeled as three places:
empty0- Cell 0 is empty (starts with 1 token)x0- Cell 0 contains X (starts with 0 tokens)o0- Cell 0 contains O (starts with 0 tokens)
The game starts with tokens in all empty places. As moves are made,
tokens flow from empty places to x or o places.
Why Places?
Places represent states in the system. A token in a place means that state is active. This declarative model lets us reason about the game mathematically.
Each possible move is a transition that:
- Consumes a token from the
emptyplace - Produces a token in the player's place (
xoro)
For example, x_move_4 (X plays center):
- Input:
empty4(must have token to fire) - Output:
x4(receives token when fired)
Win Transitions
Special transitions like win_x_row0 fire when X has tokens in positions 0, 1, and 2.
These don't consume tokens—they only check if the winning pattern exists.
The go-pflow library computes strategic values using Ordinary Differential Equations:
Strategic Value = Σ(win_paths_for_me) - Σ(win_paths_for_opponent)
How it works
- Each transition has a rate (how often it can fire)
- Token flow is simulated as continuous differential equations
- Steady-state values indicate strategic importance
Results Explained
- Center (0.430): Participates in 4 winning patterns (2 diagonals + row + column)
- Corners (0.316): Participate in 3 winning patterns
- Edges (0.218): Participate in only 2 winning patterns
These values emerge from topology alone—no hand-coded heuristics!
Every transition firing creates an event that is stored permanently:
- Events are immutable records of what happened
- Game state can be reconstructed by replaying events
- Enables undo, replay, and audit trails
Example Events
{type: "XMoved", position: 4, timestamp: "..."}
{type: "OMoved", position: 0, timestamp: "..."}
{type: "XWon", pattern: "diagonal", timestamp: "..."}
The "Move History" panel shows these events in real-time as you play.