Simon Painter
Down the Oregon Trail with Functional C#
#1about 5 minutes
Core principles of the functional programming paradigm
Functional programming is a declarative style emphasizing immutability, pure functions, and expressions over statements to write more testable and robust code.
#2about 2 minutes
Applying the umbra and penumbra metaphor to C#
Achieve nearly pure functional code by isolating necessary compromises, like I/O, to the outer edges (penumbra) of the application.
#3about 3 minutes
The historical context behind the Oregon Trail game
The game is based on the 19th-century migration of settlers in covered wagons from the US East Coast to Oregon.
#4about 7 minutes
How BASIC and time-sharing enabled interactive games
The creation of the user-friendly BASIC language and time-sharing terminals at Dartmouth University led to a boom in early computer games.
#5about 4 minutes
Analyzing the original 1975 Oregon Trail BASIC code
The original game's logic is built on line numbers, GOTO statements, and reversed IF conditions, which requires careful translation.
#6about 11 minutes
Handling impure user input with discriminated unions
Manage the side effects of console input by wrapping results in a `Maybe` type, a discriminated union representing `Something`, `Nothing`, or `Error` states.
#7about 5 minutes
Replacing indefinite loops with a functional helper
Avoid imperative `while` loops for input validation by using a recursive `iterate until` helper function that encapsulates the looping logic.
#8about 2 minutes
Structuring the main game loop with a monadic flow
Chain game events together using a `continue game` extension method that checks the game state before executing the next function, simplifying the main loop.
#9about 1 minute
Recreating the time-based hunting mini-game functionally
Implement the time-sensitive "type BANG" mechanic by injecting a time service to enable pure, testable functions for calculating shot accuracy.
#10about 3 minutes
Refactoring complex conditional logic with switch expressions
Replace the original game's convoluted, nested IF statements for rider encounters with a clean and readable C# switch expression.
#11about 3 minutes
Exploring other classic text-based games to remake
Consider other classic text-based games like Star Trek, Doctor Who, and Zork as potential future projects for functional programming exercises.
Related jobs
Jobs that call for the skills explored in this talk.
Dennemeyer Group
Hesperange, Luxembourg
Intermediate
Senior
.NET
Structured Query Language (SQL)
Matching moments
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
04:49 MIN
Using content channels to build an event community
Cat Herding with Lions and Tigers - Christian Heilmann
02:44 MIN
Rapid-fire thoughts on the future of work
What 2025 Taught Us: A Year-End Special with Hung Lee
03:39 MIN
Breaking down silos between HR, tech, and business
What 2025 Taught Us: A Year-End Special with Hung Lee
04:22 MIN
Why HR struggles with technology implementation and adoption
What 2025 Taught Us: A Year-End Special with Hung Lee
04:57 MIN
Developing resilience by expanding your capacity for failure
What 2025 Taught Us: A Year-End Special with Hung Lee
05:26 MIN
Using AI prompts to rebuild a classic 8-bit game
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
06:28 MIN
Using AI agents to modernize legacy COBOL systems
Devs vs. Marketers, COBOL and Copilot, Make Live Coding Easy and more - The Best of LIVE 2025 - Part 3
Featured Partners
Related Videos
F#, path to functional enlightenment
Onur Gumus
A Guide To Functional Programming
Jemima Abu
Functional Programming in C++
Jonathan Müller
Exploring the Latest Features of .NET and C# by Building a Game
Rainer Stropek
Java with a Clojure mindset
Dan Lebrero
Creating games to make the web fun again
Nolan Royalty
Coffee with Developers - Andrew Taylor - CODE100 Manchester
Andrew Taylor
Hacking C# from the inside - how to do anything in NET
Adam Furmanek
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Modus Create
Iserlohn, Germany
Remote
Senior
API
Erlang
Clojure
Blockchain
+2

Modus Create
Zürich, Switzerland
Remote
Senior
API
Erlang
Clojure
Blockchain
+2


Feral Interactive Limited
Charing Cross, United Kingdom
£25-30K
Junior
iOS
C++
Lua
Bash
+7

Universally Speaking
Wyboston, Chawston and Colesden, United Kingdom
JIRA
Microsoft Office


Datascope Recruitment
Remote
Intermediate
C++
Unreal Engine
Adobe Analytics

Datascope Recruitment
Remote
Intermediate
C++
Unreal Engine
Adobe Analytics

Datascope Recruitment
Remote
Intermediate
C++
Unreal Engine
Adobe Analytics