# HG changeset patch # User Robert McIntyre # Date 1332751817 18000 # Node ID 40b5bff9576cd828057f9ed1b72ae9487f948571 # Parent b7f682bb3090fd7e129f4409b2f02b7e1ea17a99# Parent 99227bec1123f40fc54a6280a119058e091f8698 merge diff -r 99227bec1123 -r 40b5bff9576c clojure/com/aurellem/exp/item_bridge.clj --- a/clojure/com/aurellem/exp/item_bridge.clj Mon Mar 26 03:45:24 2012 -0500 +++ b/clojure/com/aurellem/exp/item_bridge.clj Mon Mar 26 03:50:17 2012 -0500 @@ -95,8 +95,7 @@ ;; playable. [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:select] [:restart]]) - (play-moves - (first (title))) + (title) (advance [] [:start]) (advance [] [:a]) (advance [:a] [:a :start]))) @@ -115,7 +114,7 @@ (read-state "corrupt-mid-game")) (defn gen-start-game-corrupt [] - (->> (finish-title) + (->> (second (intro)) (advance [:b] [:a :b :start]) (play-moves (corrupt-moves)))) diff -r 99227bec1123 -r 40b5bff9576c clojure/com/aurellem/gb/items.clj --- a/clojure/com/aurellem/gb/items.clj Mon Mar 26 03:45:24 2012 -0500 +++ b/clojure/com/aurellem/gb/items.clj Mon Mar 26 03:50:17 2012 -0500 @@ -228,3 +228,5 @@ ([^SaveState state] (set-inventory state [])) ([] (clear-inventory @current-state))) + + diff -r 99227bec1123 -r 40b5bff9576c clojure/com/aurellem/gb/vbm.clj --- a/clojure/com/aurellem/gb/vbm.clj Mon Mar 26 03:45:24 2012 -0500 +++ b/clojure/com/aurellem/gb/vbm.clj Mon Mar 26 03:50:17 2012 -0500 @@ -6,7 +6,7 @@ ;;;;;;;;;;;;; read vbm file (def ^:dynamic *moves-cache* - (File. user-home "proj/pokemon-escape/moves/")) + (File. user-home "proj/vba-clojure/moves/")) (defn buttons [mask] (loop [buttons [] @@ -60,11 +60,11 @@ (recur (conj fixed mask) (drop 3 pending)) (recur (conj fixed mask) (next pending))))))) -(defn moves->filename [frame] - (File. *moves-cache* (format "%07d.vbm" frame))) +(defn moves-filename [name] + (File. *moves-cache* (format "%s.vbm" name))) -(defn read-moves [frame] - (let [target (moves->filename frame)] +(defn read-moves [name] + (let [target (moves-filename name)] (if (.exists target) (vbm-buttons target)))) ;;;;;;;;;;;;;; write moves to vbm file @@ -106,8 +106,8 @@ vbm-trailer))] contents)) -(defn write-moves! [moves] - (let [target (moves->filename (count moves))] +(defn write-moves! [moves name] + (let [target (moves-filename name)] (clojure.java.io/copy (buttons->vbm-bytes moves) target) target)) diff -r 99227bec1123 -r 40b5bff9576c clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Mon Mar 26 03:45:24 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Mon Mar 26 03:50:17 2012 -0500 @@ -1,9 +1,10 @@ (ns com.aurellem.run.bootstrap-0 (:use (com.aurellem.gb gb-driver vbm)) - (:use (com.aurellem.run title save-corruption))) + (:use (com.aurellem.run title save-corruption)) + (:use (com.aurellem.exp item-bridge))) -(defn-memo boot-0 [] +(defn-memo boot-root [] [(root) []]) diff -r 99227bec1123 -r 40b5bff9576c clojure/com/aurellem/run/save_corruption.clj --- a/clojure/com/aurellem/run/save_corruption.clj Mon Mar 26 03:45:24 2012 -0500 +++ b/clojure/com/aurellem/run/save_corruption.clj Mon Mar 26 03:50:17 2012 -0500 @@ -4,219 +4,243 @@ (use 'clojure.repl) -(defn-memo start-walking [] - (->> (finish-title) - (advance [:b] [:b :r]))) +(defn-memo start-walking + ([script] + (->> script + (advance [:b] [:b :r]))) + ([] (start-walking (finish-title)))) (def walk (partial advance [])) -(defn-memo walk-to-stairs [] - (->> (start-walking) - (walk [:u]) - (walk [:u]) - (walk [:u]) - (walk [:u]) - (walk [:u]) - (walk [:r]) - (walk [:r]) - (walk [:r]))) +(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])))) -(defn-memo walk-to-door [] - (->> (walk-to-stairs) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:d]) - (walk [:l]) - (walk [:l]) - (walk [:l]) - (walk [:l]))) - +(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])))) -(defn-memo activate-menu [] - (->> (walk-to-door) - (advance [:b] [:a :b :start]))) +(defn-memo activate-menu + ([] (activate-menu (walk-to-door))) + ([script] + (->> script + (advance [:b] [:a :b :start])))) -(defn-memo save-game [] - (->> (activate-menu) - (advance [] [:d]) - (play-moves [[] [] [] [:d] [] [] [] [:d] [] [] [:a]]) - scroll-text)) +(defn-memo save-game + ([] (save-game (activate-menu))) + ([script] + (->> script + (advance [] [:d]) + (play-moves [[] [] [] [:d] [] [] [] [:d] [] [] [:a]]) + scroll-text))) -(defn-memo corrupt-save [] - (->> (save-game) - (play-moves - ;; this section is copied from speedrun-2942 - ;; and corrupts the save so that the end-of-list marker - ;; for the pokemon roster is destroyed, but the save is still - ;; playable. - [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [:select] [:restart]]))) +(defn-memo corrupt-save + ([] (corrupt-save (save-game))) + ([script] + (->> + script + (play-moves + ;; this section is copied from speedrun-2942 and corrupts + ;; the save so that the end-of-list marker for the pokemon + ;; roster is destroyed, but the save is still playable. + [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [:select] [:restart]])))) -(defn-memo skip-title-again [] - (->> (corrupt-save) - (play-moves - (first (title))))) +(defn-memo start-game + ([] (start-game (corrupt-save))) + ([script] + (->> script + (title) + (advance [] [:start]) + (advance [] [:a]) + (advance [:a] [:a :start])))) -(defn-memo start-game [] - (->> (skip-title-again) - (advance [] [:start]) - (advance [] [:a]) - (advance [:a] [:a :start]))) - -(defn-memo destroy-item-end-of-list-marker [] - (->> (start-game) - (play-moves - [ - [:start] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] - [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] [] [] - [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] - [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] - [] [] [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:a] [] [] [:d] - [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [:u] [] [] - [] [] [:u] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] - - ;; [:b] [] [] [] [] [] [] [] [] - ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [] [][][][][] [] [] - ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [:a] [] [] - ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:d] [] - ]))) - - +(defn-memo destroy-item-end-of-list-marker + ([] (destroy-item-end-of-list-marker (start-game))) + ([script] + (->> + script + (play-moves + [[:start] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [:d] [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] + [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [] + [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] + [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] + [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] + [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] + [] [] [] [] [] [] [] [] [:u] [] [] [] [] [:u] [] [] + [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] []])))) (defn warp-to-elite-four - "This is copied from speedrun-2942 to ensure that everything is good - up to this point." + "This is copied from speedrun-2942 to ensure that + everything is good up to this point." [] (->> (corrupt-save) (play-moves - [ [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [:start] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [:start] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [:start] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] - [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] [] [] - [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] - [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] - [] [] [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:a] [] [] [:d] - [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [:u] [] [] - [] [] [:u] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [:a] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:d] [] - [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] - [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] - [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] - [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] - [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] - [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] - [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] - [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] - [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] - [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:select] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [] - [] [:b] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [:select] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [:b] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] - [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [:d] [] [] [] [] [:b] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [:select] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [] - [:d] [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] - [] [] [] [:d] [] [] [] [] [] [] [] [] [] [] [] [:select] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [:a] [] [] [:d] [] [] [:a] [:u] [] - [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] - [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] - [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] - [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] - [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] - [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] - [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] - [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] - [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [:a] [] [] [] [] - [] [:a] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] - [] [] [] [:b] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] - [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] - [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] - [:d] [:d] [:d] [:d] [:d] [:d] [:d] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [:a] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [:a] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] - [:a] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] - [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] - [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] - [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] - [] [] [] [:b]]))) - - - - - + [ [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [:start] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [:start] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [:start] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [:d] [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] + [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [] + [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] + [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] + [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] + [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] + [] [] [] [] [] [] [] [] [:u] [] [] [] [] [:u] [] [] + [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [:d] [] [] [] [:d] [] [] [] + [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] + [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] + [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] + [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] + [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] + [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] + [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] + [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] + [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] + [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] + [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] + [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:select] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [:d] [] [] [] [] [] [] [] [] [:b] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [:select] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [:d] [] [] [] [] [] [] [] [] [] [] [] + [:b] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [:d] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [:select] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] + [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [] [:d] + [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] + [] [] [] [] [] [] [] [] [] [:select] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [:a] [] [] [:d] [] [] + [:a] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] + [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] + [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] + [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] + [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] + [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] + [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] + [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] + [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] + [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] + [] [:u] [] [:u] [:a] [] [] [] [] [] [:a] [] [] [] + [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] + [] [] [] [] [] [] [:b] [:d] [:d] [:d] [:d] [:d] [:d] + [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] + [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] + [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] + [:d] [:d] [:d] [:d] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] + [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] + [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] + [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] + [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] + [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] + [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] + [:b]]))) diff -r 99227bec1123 -r 40b5bff9576c clojure/com/aurellem/run/title.clj --- a/clojure/com/aurellem/run/title.clj Mon Mar 26 03:45:24 2012 -0500 +++ b/clojure/com/aurellem/run/title.clj Mon Mar 26 03:50:17 2012 -0500 @@ -25,91 +25,104 @@ (defn start [] [[] (root)]) -(defn-memo title [] - (->> (start) - (advance [] [:a]) - (advance [] [:start]) - (advance [] [:a]) - (advance [] [:start]))) +(defn-memo title + ([] (title (start))) + ([script] + (->> script + (advance [] [:a]) + (advance [] [:start]) + (advance [] [:a]) + (advance [] [:start])))) -(defn-memo oak [] - (->> (title) - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - )) +(defn-memo oak + ([] (oak (title))) + ([script] + (->> script + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text))) -(defn-memo name-entry-rlm [] - (->> (oak) - (advance [] [:a]) - (advance [] [:r] DE) - (play-moves - [[] - [:r] [] [:r] [] [:r] [] [:r] [] - [:r] [] [:r] [] [:r] [] [:d] [:a] - [:l] [] [:l] [] [:l] [] [:l] [] - [:l] [] [:l] [:a] [] [:r] [:a] - [:r] [] [:r] [] [:r] [] [:r] [] - [:r] [] [:d] [] [:d] [] [:d] [:a] - ]))) +(defn-memo name-entry-rlm + ([] (name-entry-rlm (oak))) + ([script] + (->> script + (advance [] [:a]) + (advance [] [:r] DE) + (play-moves + [[] + [:r] [] [:r] [] [:r] [] [:r] [] + [:r] [] [:r] [] [:r] [] [:d] [:a] + [:l] [] [:l] [] [:l] [] [:l] [] + [:l] [] [:l] [:a] [] [:r] [:a] + [:r] [] [:r] [] [:r] [] [:r] [] + [:r] [] [:d] [] [:d] [] [:d] [:a]])))) -(defn-memo name-entry-ash [] - (->> (oak) - (advance [] [:d]) - (advance [] [:d]) - (advance [] [:a]))) +(defn-memo name-entry-ash + ([] (name-entry-ash (oak))) + ([script] + (->> script + (advance [] [:d]) + (advance [] [:d]) + (advance [] [:a])))) -(defn-memo rival-name-entry-gary [] - (->> (name-entry-ash) - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - (advance [] [:d]) - (advance [] [:d]) - (advance [] [:a]))) +(defn-memo rival-name-entry-gary + ([] (rival-name-entry-gary (name-entry-ash))) + ([script] + (->> script + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + (advance [] [:d]) + (advance [] [:d]) + (advance [] [:a])))) + +(defn-memo rival-name-entry-blue + ([] (rival-name-entry-blue (name-entry-ash))) + ([script] + (->> script + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + (advance [] [:d]) + (advance [] [:a])))) -(defn-memo rival-name-entry-blue [] - (->> (name-entry-ash) - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - (advance [] [:d]) - (advance [] [:a]))) +(defn-memo finish-title + ([] (finish-title (rival-name-entry-blue))) + ([script] + (->> script + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text + scroll-text))) -(defn-memo finish-title [] - (->> (rival-name-entry-blue) - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text - scroll-text)) - -(def title-frames 2323) +(def title-frames 2194) (defn title-checkpoint! [] (let [[moves state] (finish-title)] - (assert (= title-frames (:frame state))) - [(write-moves! moves) (write-state! state)])) + (assert (= title-frames (count moves))) + [(write-moves! moves "title-checkpoint") + (write-state! state "title-checkpoint")])) (defn intro [] - [(read-moves title-frames) - (read-state title-frames)]) + [(read-moves "title-checkpoint") + (read-state "title-checkpoint")]) (defn test-intro [] (play-vbm (moves->filename title-frames))) diff -r 99227bec1123 -r 40b5bff9576c moves/title-checkpoint.vbm Binary file moves/title-checkpoint.vbm has changed diff -r 99227bec1123 -r 40b5bff9576c save-states/title-checkpoint.sav Binary file save-states/title-checkpoint.sav has changed