-(ns tictactoe.core
-  (use [clojure.string :only (join)]))
+(ns tictactoe.core (use [clojure.string :only (join)]))
 
 (def center-cell-index 4)
 


(defn -main "Play the Game"
  []
  (step
    (game-board)
    "X"
    "O"
    #(player-move %1)
    #(cpu-move %1 "O")
    #(= (game-progress %1) "not-over")
    (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)
