diff clojure/com/aurellem/run/util.clj @ 317:3c5bf2221ea0

remove crufty functions.
author Robert McIntyre <rlm@mit.edu>
date Mon, 02 Apr 2012 21:25:24 -0500
parents d263df762c59
children 9a4d3f801c89
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/util.clj	Mon Apr 02 21:20:54 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/util.clj	Mon Apr 02 21:25:24 2012 -0500
     1.3 @@ -79,41 +79,6 @@
     1.4          new-state (run-moves (generator len) [alt])]
     1.5      [new-moves new-state]))
     1.6  
     1.7 -(defn delayed-difference
     1.8 -  [base alt delay difference-metric [moves root :as script]]
     1.9 -  (loop [branch-point root
    1.10 -         actions moves]
    1.11 -    (let [base-branch (step branch-point base)
    1.12 -          base-val
    1.13 -          (difference-metric
    1.14 -           (run-moves base-branch
    1.15 -                      (repeat delay base)))
    1.16 -          alt-branch (step branch-point alt)
    1.17 -          alt-val
    1.18 -          (difference-metric
    1.19 -           (run-moves alt-branch
    1.20 -                      (repeat delay base)))]
    1.21 -      (if (not= base-val alt-val)
    1.22 -        [(conj actions alt) alt-branch]
    1.23 -        (recur base-branch (conj actions base))))))
    1.24 -
    1.25 -
    1.26 -            
    1.27 -
    1.28 -
    1.29 -
    1.30 -  
    1.31 -;; (defn advance
    1.32 -;;   ([base alt difference-metric [commands state]]
    1.33 -;;      (let [[c s]
    1.34 -;;            (first-difference base alt difference-metric state)]
    1.35 -;;        [(concat commands c) s]))
    1.36 -;;   ([base alt [commands state]]
    1.37 -;;      (advance base alt AF [commands state]))
    1.38 -;;   ([alt [commands state]]
    1.39 -;;      (advance [] alt [commands state])))
    1.40 -
    1.41 -
    1.42  (def x-position-address 0xD361)
    1.43  (def y-position-address 0xD362)
    1.44  
    1.45 @@ -140,13 +105,6 @@
    1.46    (reduce (fn [script dir]
    1.47              (move dir script)) script directions))
    1.48  
    1.49 -(defn menu
    1.50 -  [directions script]
    1.51 -  (reduce (fn [script direction]
    1.52 -            (move direction script))
    1.53 -          script directions))
    1.54 -
    1.55 -
    1.56  (defn search-string
    1.57    [^SaveState state string]
    1.58    (let [codes
    1.59 @@ -172,15 +130,6 @@
    1.60                (+ text-address 82))))
    1.61    ([] (displayed-text @current-state)))
    1.62  
    1.63 -;; (defn scroll-text
    1.64 -;;   ([script]
    1.65 -;;      (first-difference [:b] [:a :b] AF script))
    1.66 -;;   ([n script]
    1.67 -;;      (reduce (fn [script _]
    1.68 -;;                (scroll-text script))
    1.69 -;;              script
    1.70 -;;              (range n))))
    1.71 -
    1.72  (defn scroll-text
    1.73    ([script]
    1.74       (delayed-difference
    1.75 @@ -191,25 +140,6 @@
    1.76               script
    1.77               (range n))))
    1.78  
    1.79 -
    1.80 -(defn end-text [script]
    1.81 -  (->> script
    1.82 -       (scroll-text)
    1.83 -       (play-moves [[] [:a]])))
    1.84 -
    1.85 -
    1.86 -
    1.87 -(memory-compare 
    1.88 - (step (talk-to-oak) [:a])
    1.89 - (step (talk-to-oak) [])
    1.90 - (step (oak-battle) [])
    1.91 - (step (oak-battle) [:a]))
    1.92 -
    1.93 - 
    1.94 -
    1.95 -
    1.96 -
    1.97 -
    1.98  (defn do-nothing [n script]
    1.99    (->> script
   1.100         (play-moves