Skip to content

Instantly share code, notes, and snippets.

@shanecharles
Last active December 6, 2017 01:30
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 shanecharles/55831582aca41430a019c4d1c6060951 to your computer and use it in GitHub Desktop.
Save shanecharles/55831582aca41430a019c4d1c6060951 to your computer and use it in GitHub Desktop.
Initial ring generation for advent of code 2017 day 3 part 1.
let rings =
seq {
yield (0,1)
yield! Seq.unfold
(fun (i, previous) ->
let ringId = i + 1
let m = (ringId, (ringId * 2 * 4) + previous)
Some (m,m)) (0,1) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment