   (not (piece? grid)))
 
 (defn gridth [[x y] border]
-  (if (in-border? [x y] border)
-    (nth (nth border y nil) x nil)
-    nil))
+  (get-in border [y x]))
 
 (defn in-empty-grid? [[x y] border]
   (empty-grid? (gridth [x y] border)))

(ns reversi.core)

(def ^:dynamic *empty-grid* 0)
(def ^:dynamic *black-piece* 1)

    (let [nearby-nonsame-color-dire-offsets
          (nearby-color-piece-dire-offsets
           (another-color-piece piece) [x y] border)]
      (loop [offsets nearby-nonsame-color-dire-offsets]
        (if-not (empty? offsets)
          (let [offset (first offsets)
                offseted-position (mapv + [x y] offset)
                target-posi (find-same-piece-on-dire offset
                                                     piece
                                                     offseted-position
                                                     border)]
            (if-not (nil? target-posi)
              true
              (recur (rest offsets)))))))))

(defn add-possible-empty-grids [possible-empty-grids [x y] border]
  (let [nearby-empty-grid-dire-offsets
