# HG changeset patch # User Robert McIntyre # Date 1320242509 25200 # Node ID 4f9ef752e2f0d37d648ae0f61ad1c3ad95c296f8 # Parent d6b8dab05d9dc28c21d7de59c2c7a32928edeec4 more cleanup and better docstrings for clojure functions diff -r d6b8dab05d9d -r 4f9ef752e2f0 org/types.org --- a/org/types.org Wed Nov 02 06:48:40 2011 -0700 +++ b/org/types.org Wed Nov 02 07:01:49 2011 -0700 @@ -76,7 +76,7 @@ | steel | 1 | .5 | .5 | .5 | 1 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 1 | 1 | .5 | The rows are attack types, while the columns are defense types. To -see the multiplier for a pokemon attack against a certain type, follow +see the multiplier for a pok\eacute{}mon attack against a certain type, follow the row for the attack type to the column of the defending type. ** Generation I Type System @@ -372,7 +372,7 @@ Now that we have a basic best-first-search, it's convenient to write a -few pokemon-type specific convenience functions. +few pok\eacute{}mon-type specific convenience functions. #+srcname: pokemon-search #+begin_src clojure :results silent @@ -476,7 +476,7 @@ : [:ghost :psychic] Ghost and Psychic also manages to have no weaknesses to any of the original -types. +types, using the old Generation I rules. #+begin_src clojure :results output :exports both (clojure.pprint/pprint @@ -545,8 +545,8 @@ ** Explanations for Common Pok\eacute{}mon Strategies -Many people start out a battle with either a normal pok\eacute{}mon or an -electric pok\eacute{}mon, and here's some justification for that choice. +Many people start out a battle with either a Normal pok\eacute{}mon or an +Electric pok\eacute{}mon. Here's some justification for that choice. #+srcname: weaknesses #+begin_src clojure :results silent @@ -619,6 +619,9 @@ (not (every? #(< 0 %) (vals (susceptibility type))))) (defn type-successors-weak + "Generate ways to weaken the given type combination. Discard type + combinations that either strengthen the given type combination or + that make it stronger" [limit type] (set (if (<= limit (count type)) '() (filter #(< 0 (type-compare-weak type %)) @@ -626,7 +629,8 @@ (defn pokemon-type-search-weak "Search among type-combos no greater than length n, limited by limit -steps of best-first-search." + steps of best-first-search. Find the weakest type combination + possible in terms of susceptance." ([n] (pokemon-type-search-weak n Integer/MAX_VALUE)) ([n limit] (first (last