comparison clojure/com/aurellem/gb/hxc.clj @ 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 a60ea8632ff4
comparison
equal deleted inserted replaced
267:498af3c3cf15 268:82ee2704c973
467 (apply assoc 467 (apply assoc
468 {} 468 {}
469 (interleave 469 (interleave
470 (map format-name (hxc-pokenames rom)) 470 (map format-name (hxc-pokenames rom))
471 (map (comp 471 (map (comp
472 (partial map vec) 472 (partial map
473 (fn [[lvl mv]] [lvl (dec mv)]))
473 (partial partition 2) 474 (partial partition 2)
474 ;; keep the learnset data 475 ;; keep the learnset data
475 (partial take-while (comp not zero?)) 476 (partial take-while (comp not zero?))
476 ;; skip the evolution data 477 ;; skip the evolution data
477 rest 478 rest
485 ([] (hxc-learnsets-pretty com.aurellem.gb.gb-driver/original-rom)) 486 ([] (hxc-learnsets-pretty com.aurellem.gb.gb-driver/original-rom))
486 ([rom] 487 ([rom]
487 (let [moves (vec(map format-name (hxc-move-names)))] 488 (let [moves (vec(map format-name (hxc-move-names)))]
488 (into {} 489 (into {}
489 (map (fn [[pkmn learnset]] 490 (map (fn [[pkmn learnset]]
490 [pkmn (map (fn [[lvl mv]] [lvl (moves (dec mv))]) 491 [pkmn (map (fn [[lvl mv]] [lvl (moves mv)])
491 learnset)]) 492 learnset)])
492 (hxc-learnsets rom)))))) 493 (hxc-learnsets rom))))))
493 494
494 495
495 496