view clojure/com/aurellem/run/save_corruption.clj @ 250:b7f682bb3090

updated title and save_corruption to work with all the recent updates
author Robert McIntyre <rlm@mit.edu>
date Mon, 26 Mar 2012 03:49:33 -0500
parents 09caf6a5bbf4
children d9e0752da684
line wrap: on
line source
1 (ns com.aurellem.run.save-corruption
2 (:use (com.aurellem.gb gb-driver vbm))
3 (:use (com.aurellem.run title)))
5 (use 'clojure.repl)
7 (defn-memo start-walking
8 ([script]
9 (->> script
10 (advance [:b] [:b :r])))
11 ([] (start-walking (finish-title))))
13 (def walk (partial advance []))
15 (defn-memo walk-to-stairs
16 ([] (walk-to-stairs (start-walking)))
17 ([script]
18 (->> script
19 (walk [:u])
20 (walk [:u])
21 (walk [:u])
22 (walk [:u])
23 (walk [:u])
24 (walk [:r])
25 (walk [:r])
26 (walk [:r]))))
28 (defn-memo walk-to-door
29 ([] (walk-to-door (walk-to-stairs)))
30 ([script]
31 (->> script
32 (walk [:d])
33 (walk [:d])
34 (walk [:d])
35 (walk [:d])
36 (walk [:d])
37 (walk [:d])
38 (walk [:l])
39 (walk [:l])
40 (walk [:l])
41 (walk [:l]))))
43 (defn-memo activate-menu
44 ([] (activate-menu (walk-to-door)))
45 ([script]
46 (->> script
47 (advance [:b] [:a :b :start]))))
49 (defn-memo save-game
50 ([] (save-game (activate-menu)))
51 ([script]
52 (->> script
53 (advance [] [:d])
54 (play-moves [[] [] [] [:d] [] [] [] [:d] [] [] [:a]])
55 scroll-text)))
57 (defn-memo corrupt-save
58 ([] (corrupt-save (save-game)))
59 ([script]
60 (->>
61 script
62 (play-moves
63 ;; this section is copied from speedrun-2942 and corrupts
64 ;; the save so that the end-of-list marker for the pokemon
65 ;; roster is destroyed, but the save is still playable.
66 [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
67 [] [] [] [] [] [] [] [] [] [] [] [:select] [:restart]]))))
69 (defn-memo start-game
70 ([] (start-game (corrupt-save)))
71 ([script]
72 (->> script
73 (title)
74 (advance [] [:start])
75 (advance [] [:a])
76 (advance [:a] [:a :start]))))
78 (defn-memo destroy-item-end-of-list-marker
79 ([] (destroy-item-end-of-list-marker (start-game)))
80 ([script]
81 (->>
82 script
83 (play-moves
84 [[:start] [] [] [] [] [] [] [] [] [] [] [] [] [] []
85 [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
86 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
87 [] [] [:d] [] [] [] [:a] [] [] [:d] [] [] [:a] [] []
88 [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] []
89 [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] []
90 [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] []
91 [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] []
92 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
93 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d]
94 [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] []
95 [] [] [] [] [] [] [] [] [:u] [] [] [] [] [:u] [] []
96 [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
97 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
98 [] [] [] [] [] [] [] [] [] [] [] []]))))
100 (defn warp-to-elite-four
101 "This is copied from speedrun-2942 to ensure that
102 everything is good up to this point."
103 []
104 (->> (corrupt-save)
105 (play-moves
106 [ [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
107 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
108 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
109 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
110 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
111 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
112 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
113 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
114 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
115 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
116 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
117 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
118 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
119 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
120 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
121 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
122 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
123 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
124 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] []
125 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
126 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
127 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
128 [] [] [] [] [] [] [] [] [:start] [] [] [] [] [] []
129 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
130 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
131 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
132 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
133 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
134 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
135 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
136 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
137 [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
138 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
139 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
140 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
141 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
142 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
143 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
144 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
145 [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
146 [:start] [] [] [] [] [] [] [] [] [] [] [] [] [] []
147 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
148 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
149 [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
150 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
151 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
152 [:start] [] [] [] [] [] [] [] [] [] [] [] [] [] []
153 [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
154 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
155 [] [] [:d] [] [] [] [:a] [] [] [:d] [] [] [:a] [] []
156 [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] []
157 [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] []
158 [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] []
159 [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] []
160 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
161 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d]
162 [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] []
163 [] [] [] [] [] [] [] [] [:u] [] [] [] [] [:u] [] []
164 [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
165 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
166 [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] [] [] []
167 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
168 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
169 [] [] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] []
170 [] [] [] [] [] [] [] [:d] [] [] [] [:d] [] [] []
171 [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d]
172 [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] []
173 [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] []
174 [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] []
175 [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d]
176 [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] []
177 [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] []
178 [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] []
179 [:d] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d]
180 [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] []
181 [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] [] [] []
182 [] [] [] [] [] [] [] [] [] [:b] [] [] [] [] [] [] []
183 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:select]
184 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
185 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b]
186 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
187 [] [] [] [] [:d] [] [] [] [] [] [] [] [] [:b] [] []
188 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
189 [] [] [:select] [] [] [] [] [] [] [] [] [] [] [] []
190 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
191 [] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] [] []
192 [] [] [] [] [:d] [] [] [] [] [] [] [] [] [] [] []
193 [:b] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
194 [:d] [] [] [] [] [:b] [] [] [] [] [] [] [] [] [] []
195 [] [] [] [] [] [] [:select] [] [] [] [] [] [] [] []
196 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b]
197 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d]
198 [] [] [] [] [] [] [] [:d] [] [] [] [] [] [] [] [:d]
199 [] [] [] [] [] [] [:d] [] [] [] [] [] [] [:d] [] []
200 [] [] [] [] [] [] [] [] [] [:select] [] [] [] [] []
201 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
202 [] [] [] [] [] [] [] [] [] [] [:a] [] [] [:d] [] []
203 [:a] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
204 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
205 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
206 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
207 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
208 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
209 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
210 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
211 [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] []
212 [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u] [] [:u]
213 [] [:u] [] [:u] [:a] [] [] [] [] [] [:a] [] [] []
214 [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
215 [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
216 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:b] [] []
217 [] [] [] [] [] [] [:b] [:d] [:d] [:d] [:d] [:d] [:d]
218 [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d]
219 [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d]
220 [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d] [:d]
221 [:d] [:d] [:d] [:d] [] [] [] [] [] [] [] [] [] [] []
222 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
223 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
224 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
225 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
226 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
227 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
228 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
229 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
230 [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] []
231 [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
232 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] []
233 [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] []
234 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
235 [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] []
236 [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
237 [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
238 [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] []
239 [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] []
240 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:a]
241 [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] []
242 [] [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] []
243 [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
244 [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] []
245 [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] []
246 [:b]])))