Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 12, 2017 18: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 deque-blog/2d30176f9e98c4c0b2dbaaae3969f570 to your computer and use it in GitHub Desktop.
Save deque-blog/2d30176f9e98c4c0b2dbaaae3969f570 to your computer and use it in GitHub Desktop.
(defn next-turn-gen
"Generator for a valid next turn from a previous valid turn"
[turn]
(gen/fmap
#(turn/next-turn turn %)
(gen/elements (vals (turn/transitions turn)))))
(gen/sample (next-turn-gen (turn/new-init-turn)) 1)
=> ;; Output not displayed since is a bit long
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment