Down the Oregon Trail with Functional C#
summary
Recreates the 1975 Oregon Trail by rewriting ~5k lines of HP Time‑Share BASIC into modern C# and ships a playable console version; enforces near 100% unit test coverage and wraps IO with discriminated unions so inputs are Maybe<string> / Result types; models game State as immutable record types, injects time and RNG services for deterministic tests, reproduces the typing-based shooting minigame, and documents compromises (one try/catch, a few while loops instead of tail-call optimization). Gameplay works and is substantially shorter and more testable than the original.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 5:21What is functional programming
- 8:53Functional C# compromises
- 11:21Oregon Trail history
- 17:17Original gameplay and code
- 23:00Functional input handling
- 33:14Inventory with immutability
- 41:18Game state recursion
- 44:48Shooting minigame logic
- 47:33Trail random events
- 51:44Legacy features and future
- 54:33Book and resources
- 59:10Q&A
related talks
01h 02mDown the Oregon Trail with Functional C#
49mRefactoring toward a more functional style in F#
53mSafety first! Low-level C# without the unsafe keyword
01h 08mThinking Functionally with C#
58mFunctional Programming with C#
52mFunctional Patterns for the Object Oriented
36mBack to the Future: How 80s Arcade Games Taught me Clojure
01h 09mFunctional Programming with C#
