     (cond
       (is-kingside-castle? move) (assoc map :rook-from (+ to 1) :rook-to (- to 1))
       (is-queenside-castle? move) (assoc map :rook-from (- to 2) :rook-to (+ to 1))
-      (move-is-ep? move) (assoc map :captured-piece (if (= stm color-white) :bp :wp)
+      (move-is-ep? move) (assoc map :captured-piece (if (= stm white) :bp :wp)
                                   :capture-square (square-make (square-file to)
                                                                (square-rank from)))
       (and (move-is-promotion? move) (not (.isEmpty board to)))

  #?(:cljs (:require [jschess.chess :as jsc])
     :clj (:import (chess Board Move PieceColor Piece Square))))

(def color-white #?(:clj PieceColor/WHITE :cljs 0))
(def color-black #?(:clj PieceColor/BLACK :cljs 1))


(defn square-make [file rank]

(defn side-to-move
  "The current side to move, :white or :black."
  [board]
  (if (= (.getSideToMove board) white)
    :white
    :black))

