# HG changeset patch # User Robert McIntyre # Date 1333802597 18000 # Node ID 2dd40f6b6a1f6bfb4c1e8e4baeb71801fd253dc7 # Parent 25b7bb7da3b1b9ed69cfac792925e4c610228823 restore memoization. diff -r 25b7bb7da3b1 -r 2dd40f6b6a1f clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Sat Apr 07 07:31:59 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Sat Apr 07 07:43:17 2012 -0500 @@ -432,31 +432,13 @@ (play-moves [[:a] []]))) (defn restart - "Two button presses after a restart event are lost when converting to - VBM format. To compensate, step the state forward two steps." - [[moves state :as script]] - (->> [(concat moves [[:restart]]) - (run-moves state [[:restart] - - - ;;[] [] - - ])] - (do-nothing 2))) - -(defn restart "The two button presses after a restart event are converted to blanks. Due to weirdness with the VBM format. To compensate, ensure that the two button presses after restart are both blanks." [script] (play-moves [[:restart] [] []] script)) - -(defn restart-wrong - [[moves state :as script]] - [(concat moves [[:restart] [] []]) - (run-moves state [[:restart]])]) -(defn do-save-corruption +(defn-memo do-save-corruption ([] (do-save-corruption (walk-to-counter))) ([script] @@ -503,7 +485,7 @@ select-menu-entry scroll-text)) -(defn corrupt-item-list +(defn-memo corrupt-item-list "Corrupt the num-of-items variable by switching a corrupted pokemon into out-of-bounds memory." ([] (corrupt-item-list @@ -525,7 +507,7 @@ close-menu close-menu))) -(defn get-lots-of-money +(defn-memo get-lots-of-money "Sell 0xFE cancel buttons to make a tremendous amount of money." ([] (get-lots-of-money (corrupt-item-list))) ([script] @@ -544,7 +526,7 @@ (defn note [str script] (println str) script) -(defn buy-bootstrapping-items +(defn-memo buy-bootstrapping-items "Buy items that will become part of the bootstrapping program." ([] (buy-bootstrapping-items (get-lots-of-money))) @@ -574,7 +556,7 @@ (play-moves [[:b]]) end-text))) -(defn corrupt-item-list-again +(defn-memo corrupt-item-list-again ([] (corrupt-item-list-again (buy-bootstrapping-items))) ([script] (->> script @@ -596,7 +578,7 @@ close-menu close-menu))) -(defn leave-viridian-store +(defn-memo leave-viridian-store ([] (leave-viridian-store (corrupt-item-list-again))) ([script] (->> script @@ -609,7 +591,7 @@ #(search-string % "Wild") (partial move direction) script)) -(defn fight-wild-pokemon +(defn-memo fight-wild-pokemon ([] (fight-wild-pokemon (leave-viridian-store))) ([script] (->> script @@ -618,7 +600,7 @@ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓]) (force-encounter →)))) -(defn run-from-pokemon +(defn-memo run-from-pokemon ([] (run-from-pokemon (fight-wild-pokemon))) ([script] (->> script @@ -630,9 +612,7 @@ (scroll-text) (scroll-text)))) -29952 - -(defn to-poke-center-computer +(defn-memo to-poke-center-computer ([] (to-poke-center-computer (run-from-pokemon))) ([script]