diff 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
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/item_bridge.clj	Sat Mar 31 00:41:28 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/item_bridge.clj	Mon Apr 02 10:58:16 2012 -0500
     1.3 @@ -10,12 +10,16 @@
     1.4  (defn corrupt-item-state []
     1.5    (read-state "corrupt-items"))
     1.6  
     1.7 -(defn view-memory-range [state start end]
     1.8 -  (dorun
     1.9 -   (map (fn [loc val]
    1.10 -          (println (format "%04X : %02X" loc val)))
    1.11 -        (range start end) (subvec (vec (memory state)) start end)))
    1.12 -  state)
    1.13 +(defn view-memory-range
    1.14 +  ([start end]
    1.15 +     (view-memory-range
    1.16 +      @current-state start end))
    1.17 +  ([state start end]
    1.18 +     (dorun
    1.19 +      (map (fn [loc val]
    1.20 +             (println (format "%04X : %02X" loc val)))
    1.21 +           (range start end) (subvec (vec (memory state)) start end)))
    1.22 +     state))
    1.23  
    1.24  (defn almost-broken
    1.25    "if one more memory location is turned into 0x03, the game crashes."