Interactive Scala/Swing simulations of physical, mathematical, and procedural systems — reaction–diffusion chemistry, Mandelbrot navigation, fluid flow, Conway’s Game of Life, spring-based snakes, stock trading strategies, wave-function collapse, and more. Each app shares a common simulator framework so you can tweak parameters and watch the system evolve in real time.
Click a thumbnail to open the full-size image.
| Simulation | Gradle task | Description |
|---|---|---|
| Reaction Diffusion | runReactiondiffusion |
Two-chemical reaction–diffusion patterns (Gray–Scott style). |
| Henon Phase Explorer | runHenonexplorer |
Explore parameters of the Hénon strange attractor. |
| Fractal Explorer | runFractalexplorer |
Zoom the Mandelbrot set; drag to zoom, undo with go-back. |
| Cave Explorer | runCave |
Generate cave maps with cellular automata. |
| Dungeon Generator | runDungeon |
Procedurally generate dungeon levels. |
| Conway’s Game of Life | runConway |
Cellular automaton with alternate rule sets; color shows age. |
| Snake | runSnake |
Spring-based snake locomotion (Gavin Miller, SIGGRAPH 1988). |
| Dice | runDice |
Histogram of rolling N dice with M sides. |
| Stock Price | runStock |
Expected outcomes for volatile stocks over many periods. |
| Stock Trading | runTrading |
Compare trading strategies on simulated price paths. |
| Habitat | runHabitat |
Multi-creature habitat with predator/prey dynamics. |
| Verhulst Population | runVerhulst |
Discrete logistic (Verhulst) population growth / chaos. |
| Voronoi Explorer | runVoronoi |
Poisson-disc sampling and Voronoi diagrams. |
| Predator Prey | runPredprey |
Fox and rabbit population curves over time. |
| Fluid | runFluid |
Deep-water fluid dynamics (Jos Stam); drag to stir. |
| Liquid | runLiquid |
Particle-based liquid simulation (Foster et al.). |
| Water | runWater |
2D deep-water waves (Kass & Miller); drag to reshape. |
| Trebuchet | runTrebuchet |
Physically based trebuchet with tunable parameters. |
| Spirograph | runSpirograph |
Parametric spirograph curves. |
| Sierpinski Triangle | runSierpinski |
Classic self-similar triangular fractal. |
| L-System Tree | runLsystem |
Fractal trees from L-system expressions. |
| Wave Function Collapse | runWaveFunctionCollapse |
Procedural scenes from seed images or tile sets. |
Developer / demo apps (not packaged as installers): runGraphing, runFuncinverse, runParameter, runComplexmapping.
Option 1 — installer (recommended): download the installer for your OS from the
latest release
(macOS .dmg, Windows .msi, Linux .deb — one installer per simulation).
Option 2 — from source:
git clone https://github.com/bb4/bb4-simulations.git
cd bb4-simulations
./gradlew runReactiondiffusion # or runSnake, runFractalexplorer, runFluid, …
./gradlew tasks --group application # list all runnable simulationsThe default ./gradlew run launches the Dice simulator. Most apps share the SimulatorApp entry point with a -panel_class argument; Gradle creates a run<App> task for each entry in appMap.
Published artifact (latest release 2.1):
implementation 'com.barrybecker4:bb4-simulation:2.1'See the releases page if you need a different version.
com.barrybecker4.simulation.common— shared Swing simulator framework (Simulator,SimulatorApp, options dialogs, animation hooks)- Per-simulation packages under
com.barrybecker4.simulation.*— model and UI for each app in the table above (e.g.reactiondiffusion,fractalexplorer,snake,fluid,waveFunctionCollapse) - Standalone launchers —
SpirographandSierpinskiAppletalso ship as their own start scripts (bb4-spirograph,bb4-sierpinski)
See the Building bb4 Projects wiki.
MIT — see LICENSE.





















