                               :rounds []}
                            :starting-score 310}))
 
+(def finished-game (atom {0 {:name "Davide"
+                             :rounds [180]}
+                          1 {:name "Steven"
+                             :rounds [0]}
+                          :starting-score 180}))
+
 (def example-game (atom {0 {:name "Davide"
                             :rounds [34 50 23 14 0]}
                          1 {:name "Steven"

(defn print-player [player-id]
  [:span  (player-name player-id) ": " (points player-id) " " (print-rounds player-id) " avg: " (average player-id)])

(defn play-page []
  [:div
   @message
   [:div
    (print-player 0)
    [:br]
    (print-player 1)]
   [:div
    [:br]
    (str (player-name @current-player) " to shoot")
    [:br]
    [:input {:type :text
             :value @score
             :on-key-press (fn [e]
                             (when (= (.-key e) "Enter")
                               (submit-score)))
             :on-change (fn [e] (let [value (str (-> e .-target .-value))
                                      value (apply str (filter #(contains? #{\1 \2 \3 \4 \5 \6 \7 \8 \9 \0} %)
                                                               value))]
                                  (reset! score value)))}]
    [:br]
    [numpad]
    [:br]
    [:a {:href "/"} "Quit, let's have a pint!"]
    (println @game)]])

(defn select-game-pane []
  [:div


(def message (atom ""))

(def game finished-game)

(def score (atom ""))
(def current-player (atom 0))
