# HG changeset patch # User Robert McIntyre # Date 1332819971 18000 # Node ID 7de2c855392c74c07b625d4e96a83c028abe2e4b # Parent 0297d315b574ce06220b39266d1032354ac8ae7e# Parent a44a2c459aeb693737c59c575f4037adb98167d2 merge diff -r a44a2c459aeb -r 7de2c855392c clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Mon Mar 26 21:25:10 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Mon Mar 26 22:46:11 2012 -0500 @@ -1,8 +1,8 @@ (ns com.aurellem.run.bootstrap-0 (:use (com.aurellem.gb gb-driver vbm characters)) (:use (com.aurellem.run title save-corruption)) - (:use (com.aurellem.exp item-bridge))) - + (:use (com.aurellem.exp item-bridge)) + (:import [com.aurellem.gb.gb_driver SaveState])) (defn-memo boot-root [] [ [] (root)]) @@ -240,3 +240,65 @@ ↑ ↑ ↑ ↑ ↑ ↑ → ↑])))) + +(defn move-thru-grass + [direction script] + (loop [blanks 0] + (let [new-script + (->> script + (play-moves (repeat blanks [])) + (move direction)) + + future-state + (run-moves (second new-script) + (repeat 600 [])) + + result (search-string (memory future-state) + "Wild")] + (if (nil? result) + new-script + (recur (inc blanks)))))) + +(defn walk-thru-grass + [directions script] + (reduce (fn [script direction] + (move-thru-grass direction script)) + script directions)) + +(defn-memo pallet-edge->viridian-mart + ([] (pallet-edge->viridian-mart + (oaks-lab->pallet-town-edge))) + ([script] + (->> script + ;; leave straight grass + (walk-thru-grass + [↑ ↑ ↑ ↑ ↑]) + + (walk [↑ ↑ ↑ ↑]) + + + (walk-thru-grass + [← ← ↑]) + (walk [↑ ↑ ↑ ↑ → → → ]) + + (walk-thru-grass + [→ ↑ ↑ ←]) + + (walk + [← ← + ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ + → → → → ]) + + (walk-thru-grass + [→ → + ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ]) + + (walk + [↑ ↑ + ← ← ← ← + ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ + ← ← + ↑ ↑ ↑ ↑ + → → → → → → → → → → + ↑ ↑ ↑ ↑ ↑ ↑])))) +