Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let turn way loc =
match way with
| L ->
match loc.dir with
| North -> { loc with dir = West }
| West -> { loc with dir = South }
| South -> { loc with dir = East }
| East -> { loc with dir = North }
| R ->
match loc.dir with
| North -> { loc with dir = East }
| East -> { loc with dir = South }
| South -> { loc with dir = West }
| West -> { loc with dir = North }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.