diff clojure/com/aurellem/gb/pokedex.clj @ 235:5becef6312b9

working on item-injection; fixed off-by-one error in print-pokedex.
author Robert McIntyre <rlm@mit.edu>
date Sat, 24 Mar 2012 20:05:47 -0500
parents 3dfb9dd3db9d
children 0e31aff20d5f
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/pokedex.clj	Sat Mar 24 16:19:43 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/pokedex.clj	Sat Mar 24 20:05:47 2012 -0500
     1.3 @@ -10,14 +10,14 @@
     1.4    (+ (if capture?
     1.5         pokedex-captured-start-address
     1.6         pokedex-seen-start-address)
     1.7 -     (int (/ (dec species-num) 8))))
     1.8 +     (int (/  (dec species-num) 8))))
     1.9    
    1.10  (defn read-pokedex
    1.11    ([^SaveState state capture? species-num]
    1.12       (bit-test
    1.13        (aget (memory state)
    1.14              (pokedex-offset capture? species-num))
    1.15 -      (rem species-num 8))))
    1.16 +      (rem (dec species-num) 8))))
    1.17  
    1.18  (defn set-pokedex
    1.19    ([^SaveState state capture? set? species-num]
    1.20 @@ -75,9 +75,9 @@
    1.21         (map #(.toUpperCase (.substring (str %) 1))
    1.22              (map pokedex-num->species-name (range 1 152)))
    1.23         (map #(if % "   X   " "       ")
    1.24 -            (map read-pokedex-seen (range 152)))
    1.25 +            (map read-pokedex-seen (range 1 152)))
    1.26         (map #(if % "   X   " "       ")
    1.27 -            (map read-pokedex-captured (range 152)))))
    1.28 +            (map read-pokedex-captured (range 1 152)))))
    1.29       (println "+-----------+-------+-------+"))
    1.30    ([] (print-pokedex @current-state)))
    1.31