Last active
March 26, 2017 12:27
-
-
Save deque-blog/924ed179efd75ed5662b875f3cf28070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn minimax-step | |
"One stage of the minimax algorithm: | |
* Apply the maximizing or mininizing step to all transitions of the turn | |
* Evaluate the lower level using the on-transition function" | |
[ai turn open-recur | |
& {:keys [max-fn min-fn] | |
:or {max-fn max, min-fn min}}] | |
(apply | |
(if (maximizing? ai turn) max-fn min-fn) | |
(map | |
(fn [[coord transition]] (open-recur coord transition)) | |
(turn/transitions turn)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment