# HG changeset patch # User Robert McIntyre # Date 1332759630 18000 # Node ID d9e0752da684fdfb73b14f3f4f920e3c798d1210 # Parent 5dafe6188ca55c40897b76ce1a80c29ee7e25444 unicode walking :) diff -r 5dafe6188ca5 -r d9e0752da684 clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Mon Mar 26 04:17:10 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Mon Mar 26 06:00:30 2012 -0500 @@ -5,7 +5,70 @@ (defn-memo boot-root [] - [(root) []]) + [ [] (root)]) +(defn-memo to-rival-name + ([] (to-rival-name (boot-root))) + ([script] + (-> script + title + oak + name-entry-rlm + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + ))) +(defn-memo name-rival-bootstrap + ([] (name-rival-bootstrap (to-rival-name))) + ([script] + (->> script + (advance [] [:a]) + (advance [] [:r] DE) + (play-moves + [[] + [:r] [] [:r] [] [:r] [] [:r] [] + [:r] [] [:r] [] [:r] [] [:d] [] + [:d] [:a] ;; space + [:l] [] [:d] [:a] ;; [PK] + [:u] [] [:u] [] [:u] [] [:l] [:a] ;; G + [:d] [] [:d] [] [:d] [] [:r] [:a] ;; [PK] + [:u] [] [:u] [] [:u] [] [:l] [:a] ;; G + [:d] [] [:d] [] [:d] [] [:r] [:a] ;; [PK] + [:d] [] [:r] [:a] ;; finish + ])))) + +(defn walk + "Move the character along the given directions." + [directions script] + (reduce (fn [script direction] + (move direction script)) + script directions)) + +(def ↑ [:u]) +(def ↓ [:d]) +(def ← [:l]) +(def → [:r]) + +(defn-memo leave-house + ([] (leave-house (name-rival-bootstrap))) + ([script] + (->> script + finish-title + start-walking + walk-to-stairs + walk-to-door + (walk [↓ ↓])))) + +(defn-memo to-pallet-town-edge + ([] (to-pallet-town-edge (leave-house))) + ([script] + (->> script + start-walking + (walk [→ → → → → + ↑ ↑ ↑ ↑ ↑ ↑])))) + + diff -r 5dafe6188ca5 -r d9e0752da684 clojure/com/aurellem/run/save_corruption.clj --- a/clojure/com/aurellem/run/save_corruption.clj Mon Mar 26 04:17:10 2012 -0500 +++ b/clojure/com/aurellem/run/save_corruption.clj Mon Mar 26 06:00:30 2012 -0500 @@ -10,35 +10,37 @@ (advance [:b] [:b :r]))) ([] (start-walking (finish-title)))) -(def walk (partial advance [])) + +(def move + (partial advance [])) (defn-memo walk-to-stairs ([] (walk-to-stairs (start-walking))) ([script] (->> script - (walk [:u]) - (walk [:u]) - (walk [:u]) - (walk [:u]) - (walk [:u]) - (walk [:r]) - (walk [:r]) - (walk [:r])))) + (move [:u]) + (move [:u]) + (move [:u]) + (move [:u]) + (move [:u]) + (move [:r]) + (move [:r]) + (move [:r])))) (defn-memo walk-to-door ([] (walk-to-door (walk-to-stairs))) ([script] (->> script - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:l]) - (walk [:l]) - (walk [:l]) - (walk [:l])))) + (move [:d]) + (move [:d]) + (move [:d]) + (move [:d]) + (move [:d]) + (move [:d]) + (move [:l]) + (move [:l]) + (move [:l]) + (move [:l])))) (defn-memo activate-menu ([] (activate-menu (walk-to-door)))