# HG changeset patch # User Robert McIntyre # Date 1332210943 18000 # Node ID c5914665012d2e749ff82bb42bfc0ba2ba186eb7 # Parent 412ca096a9ba94e3e4f525fa6bb7e35971de159d made function to get the sixth pokemon's full name diff -r 412ca096a9ba -r c5914665012d clojure/com/aurellem/exp/pokemon.clj --- a/clojure/com/aurellem/exp/pokemon.clj Mon Mar 19 21:23:46 2012 -0500 +++ b/clojure/com/aurellem/exp/pokemon.clj Mon Mar 19 21:35:43 2012 -0500 @@ -88,5 +88,16 @@ character))) +(def end-of-name-marker 0x50) +(def max-name-length 11) +(defn sixth-pokemon-name [^SaveState state] + (character-codes->str + (take-while + (partial not= 0x50) + (subvec (vec (memory state)) + sixth-pokemon-name-start + (+ (inc max-name-length) + sixth-pokemon-name-start))))) +