comparison clojure/com/aurellem/item_bridge.clj @ 142:b12d2408fd9b

moved set-memory to proper position, added pokemon.clj
author Robert McIntyre <rlm@mit.edu>
date Mon, 19 Mar 2012 19:56:55 -0500
parents 424510993296
children
comparison
equal deleted inserted replaced
141:d125a294f9d8 142:b12d2408fd9b
15 (map (fn [loc val] 15 (map (fn [loc val]
16 (println (format "%04X : %02X" loc val))) 16 (println (format "%04X : %02X" loc val)))
17 17
18 (range start end) (subvec (vec (memory state)) start end))) 18 (range start end) (subvec (vec (memory state)) start end)))
19 state) 19 state)
20
21 (defn set-memory [state location value]
22 (set-state! state)
23 (let [mem (memory state)]
24 (aset mem location value)
25 (write-memory! mem)
26 (update-state)))
27 20
28 (defn almost-broken 21 (defn almost-broken
29 "if one more memory location is turned into 0x03, the game crashes." 22 "if one more memory location is turned into 0x03, the game crashes."
30 [n] 23 [n]
31 (view-memory-range 24 (view-memory-range