On 24/08/12 18:24, [email protected] wrote:
(defn score-by-count ^long [b dir] (let [ hm (into [] (core/gather-team b dir)) aw (into [] (core/gather-team b (unchecked-negate dir)))] (unchecked-subtract (count hm) (count aw))))(defn counting-accumulator [acc _] (inc acc)) (defn score-by-count ^long [b dir] (let [ hm (core/gather-team b dir) aw (core/gather-team b (unchecked-negate dir))] (- (r/reduce counting-accumulator 0 hm) (r/reduce counting-accumulator 0 aw)))
I'm not even sure what you're doing here! but in any case, its not worth fixing/tweaking 'score-by-count' - it will never be used! in a sense it is a dummy scoring fn - I'm never going to use it...'score-naive' may be naive but is much better and more realistic. eventually i want to use a neural-net as the scoring-fn, which once it's been trained should reply fairly quickly...until then however, I'm using 'score-naive' for scoring. Each chess -piece has a relative value {:pawn 1 :bishop 3 :knight 3 :rook 6 :queen 9 :king +infinity}...this is what score-naive looks at (sums each team's relative values and subtracts them)...
In summary, it's definitely not worth optimising 'score-by-count'...it is useless!
Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
