 
 ; wake sleep state machine
 (defn main-loop []
-  (nouns/add-word "iyye.days" #(list @resource/num-days) nil)
-  (while true
     (let [current-day (resource/create-day)]
       (resource/start-day current-day)
 

        (while (not (resource/is-night-over? current-night))
          (Thread/sleep DAY_CHECK_TIME_MILLIS))

        (resource/stop-night current-night)))))

(defn- load-state [name]
  (log/info "first day load")

        "load"  (if (persistence/iyye-exists? (:name options)) (load-state (:name options)) (exit -1 "Does not exist")))))

  (doall  (iolist/init-io))
  (nouns/add-word "iyye.days" #(list @resource/num-days) nil)
  ; Start in a thread so that I can use REPL too
  (task/start-task main-task))
