-
-
Save zspencer/4d378e1d1d833041ccd5 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 walk-fn [game] | |
(assoc game :player (move-player (:player game)))) | |
(def actions-map { :walk walk-fn }) | |
;; ai is a function which returns an action keyword based upon the game state | |
(defn play-round [game ai] | |
(-> (get (ai game) actions-map) | |
(apply [game]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment