Turn any concept into an interactive simulation
PlayTheory designs, codes, sandboxes, and verifies live simulations on the fly. Move sliders, observe phase spaces, and test your mental models.
Verified Simulation Archetypes
Ready to playProjectile Drag
Observe aerodynamic drag, crosswinds, and apex trajectory angles.
ode_phasePredator-Prey
Lotka-Volterra differential equations, periodic oscillations, and 2D phase loops.
agentsEpidemic SIR
Discrete interacting agents modeling exponential spread and herd immunity.
cellular_automatonGame of Life
Conway's grid rules: underpopulation, survival, overcrowding, and gliders.
queue_flowM/M/1 Server Queue
Asymptotic non-linear queue delay explosions when arrival rate nears service capacity.
Compound AI & Verifier Architecture
Autonomous Pipeline1. Mathematical Planning & SimSpec Synthesis▾
The planner analyzes the concept, chooses the ideal mathematical archetype (particles, ode_phase, agents, cellular_automaton, or queue_flow), and produces a strictly validated JSON specification with state parameters, physical bounds, phase plots, and learning objectives.
2. Constrained JavaScript Canvas Engine▾
The code builder generates a self-contained ES2020 JavaScript simulation module. The code strictly avoids dangerous browser APIs, uses explicit parameter clamps, and exports deterministic init(), step(dt, params), and draw(ctx, width, height) interfaces.
3. Client-Side 12-Point Verifier & Self-Repair Loop▾
Before running in the UI, an Acorn AST static analyzer inspects the syntax, checks for banned globals, and injects runtime loop-guards. A headless 600-step simulation runs to detect infinite loops, numerical instability (NaN/Infinity), and dead states. If any check fails, the self-repair loop sends targeted error diagnostics back to the LLM to patch the code automatically.