view clojure/com/aurellem/save_corruption.clj @ 138:2b69cbe8a5b9

saving progress on state machine; 240 ops -> 90 ops (provided it withstands debugging)
author Dylan Holmes <ocsenave@gmail.com>
date Mon, 19 Mar 2012 03:05:42 -0500
parents 7f7cc8858d2e
children
line wrap: on
line source
1 (ns com.aurellem.save-corruption
2 (:use (com.aurellem gb-driver vbm title)))
4 (use 'clojure.repl)
6 (defn-memo start-walking []
7 (->> (finish-title)
8 (advance [:b] [:b :r])))
10 (def walk (partial advance []))
12 (defn-memo walk-to-stairs []
13 (->> (start-walking)
14 (walk [:u])
15 (walk [:u])
16 (walk [:u])
17 (walk [:u])
18 (walk [:u])
19 (walk [:r])
20 (walk [:r])
21 (walk [:r])))
23 (defn-memo walk-to-door []
24 (->> (walk-to-stairs)
25 (walk [:d])
26 (walk [:d])
27 (walk [:d])
28 (walk [:d])
29 (walk [:d])
30 (walk [:d])
31 (walk [:l])
32 (walk [:l])
33 (walk [:l])
34 (walk [:l])))
37 (defn-memo activate-menu []
38 (->> (walk-to-door)
39 (advance [:b] [:a :b :start])))
41 (defn-memo save-game []
42 (->> (activate-menu)
43 (advance [] [:d])
44 (play-moves [[] [] [] [:d] [] [] [] [:d] [] [] [:a]])
45 scroll-text))
47 (defn-memo corrupt-save []
48 (->> (save-game)
49 (play-moves
50 ;; this section is copied from speedrun-2942
51 ;; and corrupts the save so that the end-of-list marker
52 ;; for the pokemon roster is destroyed, but the save is still
53 ;; playable.
54 [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
55 [] [] [] [] [] [] [] [] [] [] [:select] [:restart]])))
57 (defn-memo skip-title-again []
58 (->> (corrupt-save)
59 (play-moves
60 (first (title)))))
62 (defn-memo start-game []
63 (->> (skip-title-again)
64 (advance [] [:start])
65 (advance [] [:a])
66 (advance [:a] [:a :start])))
68 (defn-memo destroy-item-end-of-list-marker []
69 (->> (start-game)
70 (play-moves
71 [
72 [:start] [] [] [] [] [] [] [] [] [] [] []
73 [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
74 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d]
75 [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] [] []
76 [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] []
77 [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] []
78 [] [] [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
79 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
80 [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:a] [] [] [:d]
81 [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [:u] [] []
82 [] [] [:u] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
83 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
84 [] [] [] [] [] [] [] [] [] [] []
86 ;; [:b] [] [] [] [] [] [] [] []
87 ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
88 ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [:a] [] []
89 ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:d] []
90 ])))
94 (defn warp-to-elite-four
95 "This is copied from speedrun-2942 to ensure that everything is good
96 up to this point."
97 []
98 (->> (corrupt-save)
99 (play-moves
100 [ [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
101 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
102 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
103 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
104 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
105 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
106 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
107 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
108 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
109 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
110 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
111 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
112 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
113 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
114 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
115 [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
116 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
117 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
118 [] [] [] [] [] [] [:start] [] [] [] [] [] [] [] [] [] [] [] []
119 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
120 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
121 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
122 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
123 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
124 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
125 [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] []
126 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
127 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
128 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
129 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
130 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
131 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
132 [] [] [] [] [] [] [] [] [] [:start] [] [] [] [] [] [] [] [] []
133 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
134 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a]
135 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
136 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
137 [] [] [] [] [] [] [] [:start] [] [] [] [] [] [] [] [] [] [] []
138 [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
139 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d]
140 [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] [] []
141 [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] []
142 [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] []
143 [] [] [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
144 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
145 [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:a] [] [] [:d]
146 [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [:u] [] []
147 [] [] [:u] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
148 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
149 [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] []
150 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
151 [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [:a] [] []
152 [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:d] []
153 [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] []
154 [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d]
155 [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] []
156 [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] []
157 [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] []
158 [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] []
159 [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] []
160 [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] []
161 [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d]
162 [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] []
163 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:select] [] []
164 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
165 [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] []
166 [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] []
167 [] [:b] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
168 [] [] [] [:select] [] [] [] [] [] [] [] [] [] [] [] [] [] []
169 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
170 [:b] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] []
171 [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] []
172 [] [] [] [] [] [:d] [] [] [] [] [:b] [] [] [] [] [] [] [] []
173 [] [] [] [] [] [] [] [] [:select] [] [] [] [] [] [] [] [] []
174 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] []
175 [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] []
176 [:d] [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] []
177 [] [] [] [:d] [] [] [] [] [] [] [] [] [] [] [] [:select] [] []
178 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
179 [] [] [] [] [] [] [] [] [] [:a] [] [] [:d] [] [] [:a] [:u] []
180 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
181 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
182 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
183 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
184 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
185 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
186 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
187 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
188 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [:a] [] [] [] []
189 [] [:a] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] []
190 [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
191 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] []
192 [] [] [] [:b] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d]
193 [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d]
194 [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d]
195 [:d] [:d] [:d] [:d] [:d] [:d] [:d] [] [] [] [] [] [] [] [] []
196 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
197 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
198 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
199 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
200 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
201 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
202 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
203 [:a] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] []
204 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
205 [:a] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] []
206 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
207 [:a] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] []
208 [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
209 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] []
210 [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
211 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] []
212 [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
213 [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] []
214 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] []
215 [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] []
216 [] [] [] [:b]])))