                         (world-right-upper-corner world-size)]))
       (set-player (or player-pos (world-center world-size)))))
 
+;;
+;; function specs
+;;
 (s/fdef make-game
         :args (s/cat :x (s/keys :req-un [::world-size]
                                 :opt-un [::player-pos

                                 ::recharge-delay
                                 ::last-attack]))

(s/def ::type #{:zombie :player})
(s/def ::direction #{:left :right :up :down :up-left :up-right :down-left :down-right})
(s/def ::health int?)

(s/def ::character (s/keys :req-un [::type
                                    ::direction
                                    ::health
                                    ::weapon]))

(s/def ::world-size ::position)
(s/def ::terrain (s/map-of ::position ::character
                           :min-count 1))

(s/def ::game (s/keys :req-un [::world-size
                               ::terrain]))

(s/def ::player-action (conj (s/describe ::direction) :fire))

(s/def ::player-pos ::position)
(s/def ::zombies (s/coll-of ::position :distinct true))

(defn world-center [[x y]]
  [(int (/ x 2)) (int (/ y 2))])


            [clojure.set :refer [rename-keys]]
            [clojure.spec.alpha :as s]))

;;
;; schema
;;
; weapon
(s/def ::weapon-type #{:dagger :musket :zombie-fist})
(s/def ::range (s/int-in 1 1000))
(s/def ::attack pos-int?)
