     (let [nearby-nonsame-color-dire-offsets
           (nearby-color-piece-dire-offsets
            (another-color-piece piece) [x y] border)]
-      (if-not (empty? nearby-nonsame-color-dire-offsets)
-        (loop [offsets nearby-nonsame-color-dire-offsets]
+      (loop [offsets nearby-nonsame-color-dire-offsets]
+        (if-not (empty? offsets)
           (let [offset (first offsets)
-                offsetd-position (mapv + [x y] offset)
+                offseted-position (mapv + [x y] offset)
                 target-posi (find-same-piece-on-dire offset
                                                      piece
-                                                     offsetd-position
+                                                     offseted-position
                                                      border)]
-            (cond (and (nil? target-posi) (not (nil? offsets)))
-                  (recur (rest offsets))
-                  (not (nil? target-posi))
-                  true)))))))
+            (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

(ns reversi.core)

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

  (not (piece? grid)))

(defn gridth [[x y] border]
  (get-in border [y x]))

(defn in-empty-grid? [[x y] border]
  (empty-grid? (gridth [x y] border)))
