Created
March 3, 2014 00:50
-
-
Save tarynsauer/9316549 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 next-move [board player-x player-o] | |
| (player-move-message (current-piece board)) | |
| (print-board board) | |
| (let [move (get-move (current-player board player-x player-o) board)] | |
| (if (valid-move? board move) | |
| (apply-move board move) | |
| (recur board player-x player-o)))) | |
| (defn play [board player-x player-o] | |
| (loop [board board player-x player-x player-o player-o] | |
| (if (game-over? board) | |
| (game-over-message board (opponent board)) | |
| (recur (next-move board player-x player-o) player-x player-o)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment