Skip to content

Instantly share code, notes, and snippets.

@zakaluka
Created February 17, 2017 17:42
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/3b2be94503074b911945c7c26cf2cd53 to your computer and use it in GitHub Desktop.
Save zakaluka/3b2be94503074b911945c7c26cf2cd53 to your computer and use it in GitHub Desktop.
let moveAll strList =
Regex.Matches (strList, @"[LR]\d+")
|> Seq.cast
|> Seq.fold
(fun oldloc (instr : System.Text.RegularExpressions.Match) ->
move
(instr.Value.[0] |> toTurn)
(instr.Value.Substring 1 |> int)
oldloc
)
startLoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment