comparison clojure/com/aurellem/gb_driver.clj @ 105:2f8089eacab9

working on some actual assembly programs
author Robert McIntyre <rlm@mit.edu>
date Tue, 13 Mar 2012 14:40:01 -0500
parents d2e00ea31508
children 3a60bb14a64a
comparison
equal deleted inserted replaced
104:d2e00ea31508 105:2f8089eacab9
91 (def current-state (atom nil)) 91 (def current-state (atom nil))
92 92
93 (defn set-state! [^SaveState state] 93 (defn set-state! [^SaveState state]
94 (assert (:data state) "Not a valid state!") 94 (assert (:data state) "Not a valid state!")
95 (if (not @on?) (restart!)) 95 (if (not @on?) (restart!))
96 (if (not= @current-state state) 96 (Gb/loadState (:data state))
97 (Gb/loadState (:data state)))
98 (reset! current-state state)) 97 (reset! current-state state))
99 98
100 (defrecord Move [keys state]) 99 (defrecord Move [keys state])
101 100
102 (defn update-state [] 101 (defn update-state []