Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created March 1, 2017 20:40
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/c039a7725013183e35581150367b13f9 to your computer and use it in GitHub Desktop.
Save deque-blog/c039a7725013183e35581150367b13f9 to your computer and use it in GitHub Desktop.
(defn next-turn
"Convert a cell to the player color and switch player"
[turn coord]
(if-not (or (game-over? turn) (invalid-move? turn coord))
(-> turn
(update :board board/convert-cell (:player turn) coord)
(update :player next-player))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment