Functional Game Logic with State Pipelines - F# Part 3 [Episode 003]
System Crafters
In this episode we start building the basic logic for our text adventure game by constructing a logic pipeline that transforms the game world state. We cover match expressions, parameter destructuring, and a technique known as Railway-Oriented Programming.
Source code for this episode: https://gist.github.com/daviwil/3419811b3bfed172b7888efe2a0e1436
Sections:
- Data Model Review [1:53]
- Defining a Logic Pipeline [4:38]
- Match Expressions [10:10]
- Defining the Move Function [14:06]
- Parameter Destructuring [15:08]
- Railway-Oriented Programming [19:16]
- Defining the Result Type [20:06]
- Defining the Bind Function [23:04]
- Defining the Switch Function [25:13]
- Defining a Bind Operator [36:15]
- Handling Failure Results [38:35]
Links:
- Scott Wlaschin's excellent F# site: http://fsharpforfunandprofit.com
- Scott's post on Railway-Oriented Programming: https://fsharpforfunandprofit.com/posts/recipe-part2/
Follow David on Twitter: https://twitter.com/daviwil ... https://www.youtube.com/watch?v=PFWYwr7Hhhg
2020-10-14
0.30084831 LBC
Copyrighted (contact publisher)
207463553 Bytes