diff clojure/com/aurellem/gb/hxc.clj @ 252:2b6bd03feb4f

minor correction.
author Robert McIntyre <rlm@mit.edu>
date Mon, 26 Mar 2012 04:03:19 -0500
parents 99227bec1123
children b2f9a0cb13e3
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/hxc.clj	Mon Mar 26 03:50:17 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/hxc.clj	Mon Mar 26 04:03:19 2012 -0500
     1.3 @@ -331,24 +331,26 @@
     1.4    "Returns all the maps that make the same associations as proto-map."
     1.5    (some (partial submap? proto-map) maps))
     1.6  
     1.7 -;; (I don't use this for anything so far.)
     1.8 -;;
     1.9 -;; (defn filter-vals
    1.10 -;;   "Returns a map consisting of all the pairs [key val] for which (pred
    1.11 -;;   key) returns true."
    1.12 -;;   [pred map]
    1.13 -;;   (reduce (partial apply assoc) {} (filter (fn [[k v]] (pred v)) map)))
    1.14 +(defn filter-vals
    1.15 +  "Returns a map consisting of all the pairs [key val] for
    1.16 +  which (pred key) returns true."
    1.17 +  [pred map]
    1.18 +  (reduce (partial apply assoc) {}
    1.19 +          (filter (fn [[k v]] (pred v)) map)))
    1.20  
    1.21  
    1.22  (defn search-moves
    1.23 -  "Returns a subcollection of all hardcoded moves with the given
    1.24 -  attributes. Attributes consist of :name :power :accuracy :pp :fx-id
    1.25 -  (and also :fx-txt, but it contains the same information as :fx-id)" 
    1.26 +  "Returns a subcollection of all hardcoded moves with the
    1.27 +  given attributes. Attributes consist of :name :power
    1.28 +  :accuracy :pp :fx-id
    1.29 +  (and also :fx-txt, but it contains the same information
    1.30 +  as :fx-id)"
    1.31    ([attribute-map]
    1.32 -     (search-moves com.aurellem.gb.gb-driver/original-rom attribute-map))
    1.33 +     (search-moves
    1.34 +      com.aurellem.gb.gb-driver/original-rom attribute-map))
    1.35    ([rom attribute-map]
    1.36 -     (filter-vals (partial submap? attribute-map) (hxc-move-data
    1.37 -                                                   rom))))
    1.38 +     (filter-vals (partial submap? attribute-map)
    1.39 +                  (hxc-move-data rom))))
    1.40  
    1.41    
    1.42