Created
August 11, 2017 10:14
-
-
Save pelensky/340f546e43ef991dff01a1ab6cde9b37 to your computer and use it in GitHub Desktop.
App Runner namespace, with parts of the code I haven't changed removed.
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
(ns tic-tac-toe.app-runner | |
(:require clj-http.client :as client])) | |
; Code removed | |
(defn- api-call [board-state] | |
(let [result (client/post "https://xast1bug7h.execute-api.us-east-1.amazonaws.com/ttt" {:form-params {"boardState" (str board-state)} :content-type :json} )] | |
(read-string (get result :body)))) | |
(defn- player-move [board-state player] | |
(case player | |
:human (human/choose-space) | |
:random-computer (random-computer/choose-space board-state) | |
:unbeatable-computer (api-call board-state))) | |
; Code removed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment