Skip to content

Instantly share code, notes, and snippets.

@pumpkincouture
Created March 29, 2015 23:58
Show Gist options
  • Select an option

  • Save pumpkincouture/6b2c2bb7cba739688d3f to your computer and use it in GitHub Desktop.

Select an option

Save pumpkincouture/6b2c2bb7cba739688d3f to your computer and use it in GitHub Desktop.
(def options-list (atom {:first-marker "first-marker" :second-marker "second-marker" :board "board" :first-type "first-type" :second-type "second-type"}))
(def add-to-options (fn [symbol option] (swap! options-list assoc-in [symbol] option)))
(defn get-first-player []
(ui/prompt-for-piece))
(defn get-second-player []
(ui/prompt-for-ai-piece))
(defn get-board []
(vec (range 1 (inc 9))))
(defn get-options []
(add-to-options :first-marker (get-first-player))
(add-to-options :second-marker (get-second-player))
(add-to-options :board (get-board))
(add-to-options :first-type "human")
(add-to-options :second-type "ai"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment