Public · Economic simulation

Lemonade

A reconstruction of the classic Lemonade Stand built around three operating decisions, one day of sales and immediate economic consequences.

Niche
Accessible business simulation
Core stack
TypeScript · Lit · Three.js · Vite 8 · deterministic simulation
Interaction
Inventory · advertising · price · submit
Presentation
Vector 3D · procedural audio · accessible charts

System view

ConditionsThree decisionsDeterministic dayCertified ledger

The study

Lemonade keeps the daily operating surface to three decisions: inventory, advertising and price.

Weather and market sentiment act as conditions to interpret. The result is a compact business simulation that teaches demand, risk, diminishing returns and cash discipline through repeated play.

System structure

Three variables form the complete daily control surface.

Small control surface

Complexity appears through consequences, environment and progression.

Deterministic economic model

The simulation preserves the recognizable shape of the Apple II economics through typed, testable rules.

Progressive responsibility

Taxes, banking costs, interest and supplier economics extend the economic model while preserving the core daily decision loop.

Historical character

Vector 3D and procedural audio reference the charm of early computer games through an original contemporary presentation.

Product and interaction design

The interface presents the stand, weather and three daily decisions directly.

The neighborhood, stand activity, weather, customer flow and short audio motifs make the economic result feel like a day that happened. Charts and the ledger provide a second layer for reflection before the next decision cycle.

Keyboard play, precise numeric entry, reduced-motion modes, non-color cues and textual equivalents form part of the core interaction design.

Recent development

The simulation can demonstrate that its economy is repeatable, portable and reviewable.

Versioned persistence preserves phase and random-generator state, adds IndexedDB autosave, and supports import, export and reset while retaining deterministic replay.

A separate balance-certification layer runs fixed-seed strategies, checks accounting and gameplay invariants, and produces deterministic reports in CI. Game balance becomes reviewable evidence that can be compared across changes.

Reproducible persistence

A saved run restores both visible state and the random sequence that determines future days.

Certified balance

Reference strategies and demand probes catch regressions in difficulty, accounting and economic response.

Architecture lens

The economic simulation is deliberately unable to reach ambient platform state.

Simulation code cannot import UI, scene, audio, Tauri or Node layers and cannot call ambient random, clock or timer APIs. Those constraints keep the economic model deterministic, portable and independently testable while presentation remains free to evolve.

Determinism by construction

Randomness and time enter through explicit inputs rather than Math.random(), Date.now() or background timers, so a seed and command history can reproduce the same day.

Adapters surround the model

Lit UI, Three.js scenes, Web Audio, persistence and optional native packaging consume simulation output without becoming dependencies of the rules themselves.

Certification beyond unit tests

Fixed-seed strategies and demand probes exercise accounting and balance invariants in CI, making economic regressions observable as evidence rather than subjective play impressions.

Responsive policy is enforced

Mobile-first breakpoints, semantic dialog behavior, hover capability checks and layout anti-pattern rules are promotion gates rather than review preferences.

Development approach

The method begins playfully and gives useful discoveries rigorous support.

The architecture keeps deterministic accounting and demand rules in a pure package with injected randomness and fixed-precision money. Native DOM/SVG presentation, Three.js rendering, Web Audio, storage and optional Tauri capabilities remain adapters around that core.

A new weather curve, visual treatment, sound idea or unusual strategy can be tried quickly and replayed against the same seeds. The working loop is hypothesis → playable experiment → deterministic comparison → promote or revise.

AI-assisted development follows the same discipline: small reversible changes, explicit intent, fixed-seed tests and reviewable reports let rapid implementation amplify exploration while preserving the game’s economic character.

Next: Booking→