Dungeons, Dragons and Functions
summary
Reconstructs D&D rules into precise F# types and shows how F# discriminated unions and records make impossible states unrepresentable, turning vague 300–1,000+ page rulebooks into code. Implements a custom dice DSL and an interpreter that evaluates expressions like “2d4+10”. Ships a working D&D combat simulator compiled to JavaScript with a web UI that both simulates millions of fights for balance and runs simple AI strategies, aiming next at reinforcement learning for smarter monsters.
AI-written summary · about
chapters (21)
- 0:00Start
- 1:40Origin Story
- 4:44What makes a game interesting
- 6:14Player's Handbook (PHB)
- 7:21Playing D&D
- 9:28Ogres, Goblins, & Company
- 10:37Abilities
- 11:01Discriminated Union
- 11:57Pattern Matching
- 12:41Modifiers
- 16:09Goblin attacks
- 17:17Different structure: OR
- 18:24Attack: a sketch
- 19:33Pattern Match to extract data
- 20:50Modules
- 24:38Wyvern attacks
- 27:58The truth...
- 44:05Evaluation
- 52:36Automated Decision Making
- 54:54What's missing
- 58:20Thank Youl (Cast Bless)
related talks
01h 02mDungeons, Dragons and Functions
59mDungeons, Dragons and Functions
01h 01mDungeons, Dragons and Functions
27mComputation expressions in context
53mIntroduction to T(ype)DD with F# and Reactive Web Apps with Fable.io
52mF# in the real world
01h 00mF# in the Real World
43mWrite your own domain specific language with F#
