   (let [[f r] (vec p)]
     [(- 8 (parse-int r)) (file->i f)]))
 
-(declare valid-piece?)
-
 (defn in
   "Get the contents of a square on the board. Nil if empty"
   [board sq]
-  (let [p (get-in board (to-board-ks sq))]
-    (if (valid-piece? p) p)))
+  (get-in board (to-board-ks sq)))
 
 (defn put
   "Puts a piece at a square in the board"

(ns chess.core
  (:require [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]
            [clojure.string :refer [upper-case]]))

(def initial-board
  [[:r :n :b :q :k :b :n :r]
   [:p :p :p :p :p :p :p :p]
   [:. :. :. :. :. :. :. :.]
   [:. :. :. :. :. :. :. :.]
   [:. :. :. :. :. :. :. :.]
   [:. :. :. :. :. :. :. :.]
   [:P :P :P :P :P :P :P :P]
   [:R :N :B :Q :K :B :N :R]])

(def empty-sq :.)

(def pieces {:r "rook" :R "rook"
             :n "knight" :N "knight"

             :k "king" :K "king"
             :p "pawn" :P "pawn"})

(let [f-to-i (into {}
              (map-indexed
               (fn [i c] [c i])
               (seq "abcdefgh")))
      i-to-f (map-invert f-to-i)]
  (do
    (defn file->i [f] (get f-to-i (char f)))
    (defn i->file [i] (get i-to-f i))))

(defn parse-int
  [i]
