Slots Engine
A skinnable slot-machine game engine — YAML-driven machine definitions, configurable reel sets, paylines and bonus rounds.
This started as a question: how much of a slot machine is genuinely game-specific versus infrastructure? The answer turned out to be: not much. Almost everything — reel layouts, symbol weights, payline patterns, scatter triggers, free-spin mechanics, bonus round logic — can be expressed as data if the engine is designed around it.
The result is a YAML-driven machine-definition format that lets you specify a complete slot game without writing code. The reference implementation is Temple of Ra, a five-reel Egyptian-themed machine with cascading wilds, a free-spins trigger on scatter symbols and a pick-bonus round. The same engine file powers both the maths (spin simulation, return-to-player calculation) and the presentation layer.
Architecture
The back-end is Haskell + Yesod. Haskell's algebraic types make the spin-result and payout-evaluation logic clean and exhaustive — every symbol, every payline configuration, every bonus state has an explicit type, and the compiler refuses to let you forget a case. The RNG is seeded server-side and the full spin result (all reels, all wins, all bonus triggers) is computed atomically before anything is sent to the client.
The front-end is a Vite application handling animation, sound cues and the bonus UI. The clean split means you can swap the visual skin — reels, symbols, fonts, soundtrack — without touching the game logic, or replace the game logic with a new machine definition without touching the presentation.
What it's for
It's a vehicle for exploring data-driven game design and the ergonomics of a well-typed server-side game loop. It also makes a genuinely playable demo — which is a nice property for a side project to have.