Skip to content

Instantly share code, notes, and snippets.

@zakaluka
Created February 17, 2017 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zakaluka/f62081b26f5d9d6f415cc247460d22d9 to your computer and use it in GitHub Desktop.
Save zakaluka/f62081b26f5d9d6f415cc247460d22d9 to your computer and use it in GitHub Desktop.
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