 (def winning-k 3)
 
 
-(defn new-board
-  [n]
+(defn new-board [n]
   (vec (repeat n (vec (repeat n "B")))))
 
 (defonce app-state (atom {:text "Welocome to tic-tac-toe!!"

(defn first-occupied-line [board]
  (first (filter #(occupied-line? (get-coords board %)) (all-lines-coords))))

(defn computer-move [board]
  (let [move (or 
              (not-empty (free-spot board  (first (threat-lines "O" "X" board)))) 
              (not-empty (free-spot board  (first (threat-lines "X" "O" board)))) 
              (not-empty (free-spot board (first-occupied-lines board)))
              (rand-nth (free-spots board)))]
    (assoc-in board move "O")))


(ns tictactoe.core
(:require [reagent.core :as reagent :refer [atom]]))

(enable-console-print!)

