Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active March 26, 2017 13:26
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/362b27d61036462d80131fbcf78cdfbb to your computer and use it in GitHub Desktop.
Save deque-blog/362b27d61036462d80131fbcf78cdfbb to your computer and use it in GitHub Desktop.
(defn optimize-own-score-ai
"Create an AI strategy to optmize its own score: good late game play"
[player]
(reify minimax/AIStrategy
(eval-turn [this turn] (eval-next-score-of this turn [player]))
(maximizing? [_ turn] (= (:player turn) player))
))
(defn optmize-ai-scores-ai
"Create an AI strategy to optmize the AI scores: good cheat when the player wins"
[]
(reify minimax/AIStrategy
(eval-turn [this turn] (eval-next-score-of this turn [:red :green]))
(maximizing? [_ turn] (not= (:player turn) :blue))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment