comparison 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
comparison
equal deleted inserted replaced
159:d92f7d68445a 160:9ca350a476f0
514 ([n new-id] 514 ([n new-id]
515 (set-pokemon-id @current-state n new-id))) 515 (set-pokemon-id @current-state n new-id)))
516 516
517 517
518 518
519
520
521 (defn get-pokemon-1-info
522 ([state]
523 (subvec (vec (memory state))
524 0xD162 0xD197))
525 ([] (get-pokemon-1-info @current-state)))
526
527 (def baseline (File. "/home/r/baseline-poke"))
528
529
530
531
532 (import java.io.File)
533
534 (defn set-baseline [state]
535 (clojure.java.io/copy
536 (with-out-str (print-listing state 0xD162 0xD197))
537 baseline))
538
539
540
541 (defn compare-pokemon
542 ([state]
543 (let [target (File. "/home/r/temp-poke")]
544 (clojure.java.io/copy
545 (with-out-str (print-listing state 0xD162 0xD197))
546 target)
547 (println (:out
548 (clojure.java.shell/sh "diff"
549 (.getCanonicalPath baseline)
550 (.getCanonicalPath target))))))
551 ([] (compare-pokemon-1 @current-state)))
552
553
554 (defn crazy-pid []
555 (read-state "crazy-pidgeot"))