Mercurial > vba-clojure
changeset 268:82ee2704c973
Since the game uses zeros as delimiters in the evolution/learnset section, it increments all of the move/pokemon indices by 1. Altered my code so that all returned values are consistently non-incremented.
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Mon, 26 Mar 2012 23:25:18 -0500 |
parents | 498af3c3cf15 |
children | d68a191997ca |
files | clojure/com/aurellem/gb/hxc.clj |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/gb/hxc.clj Mon Mar 26 23:18:22 2012 -0500 1.2 +++ b/clojure/com/aurellem/gb/hxc.clj Mon Mar 26 23:25:18 2012 -0500 1.3 @@ -469,7 +469,8 @@ 1.4 (interleave 1.5 (map format-name (hxc-pokenames rom)) 1.6 (map (comp 1.7 - (partial map vec) 1.8 + (partial map 1.9 + (fn [[lvl mv]] [lvl (dec mv)])) 1.10 (partial partition 2) 1.11 ;; keep the learnset data 1.12 (partial take-while (comp not zero?)) 1.13 @@ -487,7 +488,7 @@ 1.14 (let [moves (vec(map format-name (hxc-move-names)))] 1.15 (into {} 1.16 (map (fn [[pkmn learnset]] 1.17 - [pkmn (map (fn [[lvl mv]] [lvl (moves (dec mv))]) 1.18 + [pkmn (map (fn [[lvl mv]] [lvl (moves mv)]) 1.19 learnset)]) 1.20 (hxc-learnsets rom)))))) 1.21