diff clojure/com/aurellem/exp/pokemon.clj @ 160:9ca350a476f0

discovered hex values for pokemon species.
author Robert McIntyre <rlm@mit.edu>
date Tue, 20 Mar 2012 05:18:31 -0500
parents 9367bb5e55e6
children cd7979aa544e
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/pokemon.clj	Tue Mar 20 03:54:15 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/pokemon.clj	Tue Mar 20 05:18:31 2012 -0500
     1.3 @@ -516,3 +516,40 @@
     1.4  
     1.5  
     1.6  
     1.7 +
     1.8 +
     1.9 +(defn get-pokemon-1-info
    1.10 +  ([state]
    1.11 +     (subvec (vec (memory state))
    1.12 +             0xD162 0xD197))
    1.13 +  ([] (get-pokemon-1-info @current-state)))
    1.14 +
    1.15 +(def baseline (File. "/home/r/baseline-poke"))
    1.16 +
    1.17 +
    1.18 +
    1.19 +
    1.20 +(import java.io.File)
    1.21 +
    1.22 +(defn set-baseline [state]
    1.23 +  (clojure.java.io/copy 
    1.24 +   (with-out-str (print-listing state 0xD162 0xD197))
    1.25 +   baseline))
    1.26 +
    1.27 +
    1.28 +
    1.29 +(defn compare-pokemon
    1.30 +  ([state]
    1.31 +     (let [target (File. "/home/r/temp-poke")]
    1.32 +       (clojure.java.io/copy 
    1.33 +        (with-out-str (print-listing state 0xD162 0xD197))
    1.34 +        target)
    1.35 +       (println (:out
    1.36 +                 (clojure.java.shell/sh "diff"
    1.37 +                                        (.getCanonicalPath baseline)
    1.38 +                                        (.getCanonicalPath target))))))
    1.39 +  ([] (compare-pokemon-1 @current-state)))
    1.40 +                                  
    1.41 +
    1.42 +(defn crazy-pid []
    1.43 +  (read-state "crazy-pidgeot"))