 
 (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 winning-move? [board move player] (winning-board? (game-board board move player) player))
 
 (defn best-case
   [player move board depth minimising winning-player]
-  ; (println depth)
-  ; (println (render board))
   (cond
     (winning-board? (game-board board move player) winning-player) (- 10 depth)
     (winning-board? (game-board board move player) (opponent winning-player)) (- depth 10)


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

    (apply (cond minimising min :else max)
      (map
        #(best-case (opponent player) %1 (game-board board move player) (+ 1 depth) (not minimising) winning-player)
        (valid-moves (game-board board move player))))))

(defn cpu-move
  [board player]
  (if (empty-board? board) center-cell-index
    (apply max-key #(best-case player %1 board 0 true player) (valid-moves board))))

