Meetup 15: Monopoly in OCaml continued - part 4
· One min read
@theteachr showed us the new game loop using Seq.of_dispenser
making the game loop look like this.
let () =
let game =
[ "ocaml"; "reason"; "melange"; "dune" ]
|> List.map Player.make
|> Game.start
in
read_command
|> Seq.of_dispenser
|> Seq.filter_map Command.parse
|> Seq.scan Command.exec game
|> Seq.take_while Game.is_not_over
|> Seq.iter Tui.draw
Highlights
We discussed,
- Possible use of GADTs for handling propert card transformations. You can find the git branch here
- use of
Seq.unfold
. Code - Modular card transformations. Code
Next Meetup
Checkout Upcoming Meetups
Stay in touch with us
Twitter: https://x.com/ReasonBangalore