comparison clojure/com/aurellem/exp/item_bridge.clj @ 313:8e63b0bb8ea3

major refactoring; made (walk) more robust
author Robert McIntyre <rlm@mit.edu>
date Mon, 02 Apr 2012 10:58:16 -0500
parents b7f682bb3090
children 92c47a9cdaea
comparison
equal deleted inserted replaced
305:7998b1cf18cf 313:8e63b0bb8ea3
8 (second (destroy-item-end-of-list-marker))) 8 (second (destroy-item-end-of-list-marker)))
9 9
10 (defn corrupt-item-state [] 10 (defn corrupt-item-state []
11 (read-state "corrupt-items")) 11 (read-state "corrupt-items"))
12 12
13 (defn view-memory-range [state start end] 13 (defn view-memory-range
14 (dorun 14 ([start end]
15 (map (fn [loc val] 15 (view-memory-range
16 (println (format "%04X : %02X" loc val))) 16 @current-state start end))
17 (range start end) (subvec (vec (memory state)) start end))) 17 ([state start end]
18 state) 18 (dorun
19 (map (fn [loc val]
20 (println (format "%04X : %02X" loc val)))
21 (range start end) (subvec (vec (memory state)) start end)))
22 state))
19 23
20 (defn almost-broken 24 (defn almost-broken
21 "if one more memory location is turned into 0x03, the game crashes." 25 "if one more memory location is turned into 0x03, the game crashes."
22 [n] 26 [n]
23 (view-memory-range 27 (view-memory-range