           (println "COMMAND")
           (let [choice (read-line)]
             (condp = choice
-              "0" (n/set-course-command)
-              "1" (w/short-range-scan-command)
-              "2" (w/long-range-scan-command)
-              "3" (e/fire-phasers-command)
-              "4" (e/fire-torpedoes-command)
-              "5" (e/shield-control-command)
-              "6" (e/damage-control-report-command)
+              "0" (n/set-course-command game-state)
+              "1" (w/short-range-scan-command game-state)
+              "2" (w/long-range-scan-command game-state)
+              "3" (e/fire-phasers-command game-state)
+              "4" (e/fire-torpedoes-command game-state)
+              "5" (e/shield-control-command game-state)
+              "6" (e/damage-control-report-command game-state)
               "7" (library-computer)
               "q" (dosync (alter stop-condition (fn [_] true)))
               (command-help)

  (let [seed (parse-number (read-line))]
    (binding  [gen/*rnd*  (java.util.Random. seed)])

    (with-redefs [u/message println]
    (play-game))))

       edn/read-string
       (map :page)))

(defn parse-number
  "Reads a number from a string. Returns nil if not a number."
  [s]
  (if (re-find #"^-?\d+\.?\d*$" s)
    (read-string s)
    (let [s2 (str "0" s)]
      (if (re-find #"^-?\d+\.?\d*$" s2)
        (read-string s2)))))

(defn print-instructions [pause]
  (loop [p pages]
