Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 28, 2017 05:14
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/59ce941648c3db8a4d9cab3debb0c111 to your computer and use it in GitHub Desktop.
Save deque-blog/59ce941648c3db8a4d9cab3debb0c111 to your computer and use it in GitHub Desktop.
(defn- game-tree-search
"The top level of the minimax algorithm
* Trigger sub-game-trees minimax evaluations
* Remember the transition that led to the max"
[ai turn depth]
(first
(ai-algo/minimax-step-by
second ai turn
(fn [coord transition]
(let [new-turn (turn/next-turn turn transition)]
[coord (ai-algo/minimax ai new-turn depth)]))
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment