 
 (defn -main "Play the Game"
   []
-  (step
-    (game-board)
-    "X"
-    "O"
-    #(player-move %1)
-    #(cpu-move %1 "O")
-    #(= (game-progress %1) "not-over")
-    (BoardPresenter.)))
+  (step (game-board) "X" "O" #(player-move %1) #(cpu-move %1 "O") #(= (game-progress %1) "not-over") (BoardPresenter.)))

  (render-board presenter board)
  (if (in-progress? board)
    (recur
      (game-board board (player-move board) player)
      opponent
      player
      opponent-move
      player-move
      in-progress?
      presenter)
    (game-over presenter board)))

(deftype BoardPresenter


(defn valid-moves [board] (filter #(= (get board %1) "") (take 9 (range))))

(defn winning-move? [board move player] (winning-board? (game-board board move player) player))

(defn best-case
  [player move board depth minimising winning-player]
  (cond
    (winning-board? (game-board board move player) winning-player) (- 10 depth)
    (winning-board? (game-board board move player) (opponent winning-player)) (- depth 10)
