comparison clojure/com/aurellem/run/bootstrap_1.clj @ 360:51aa6486c2ab

repairing route
author Robert McIntyre <rlm@mit.edu>
date Mon, 09 Apr 2012 08:51:47 -0500
parents 8c474d1d6956
children 64d09d021025
comparison
equal deleted inserted replaced
359:8c474d1d6956 360:51aa6486c2ab
106 0x18 ;; relative jump backwards 106 0x18 ;; relative jump backwards
107 0xCD ;; literal -51 == TM05; go back to input section 107 0xCD ;; literal -51 == TM05; go back to input section
108 0x01 ;; (item-hack) will never reach this instruction 108 0x01 ;; (item-hack) will never reach this instruction
109 109
110 ] 110 ]
111 (repeat 8 [0xFF 0x01]) 111 (repeat 8 [0x00 0x01])
112 112
113 [;; jump to actual program 113 [;; jump to actual program
114 0x00 114 0x00
115 0x37 ;; (item-hack) set carry flag no-op 115 0x37 ;; (item-hack) set carry flag no-op
116 116
278 (deposit-held-item 0 0x1) 278 (deposit-held-item 0 0x1)
279 ((fn [script] 279 ((fn [script]
280 (reduce 280 (reduce
281 (fn [script item] (deposit-held-item item 0xFF script)) 281 (fn [script item] (deposit-held-item item 0xFF script))
282 script 282 script
283 (range 3 (+ 12 3))))) 283 (range 3 (+ 13 3)))))
284 close-all-menus))) 284 close-all-menus)))
285 285
286 286
287 (defn-memo prepare-celadon-warp 287 (defn-memo prepare-celadon-warp
288 ([] (prepare-celadon-warp (initial-deposits))) 288 ([] (prepare-celadon-warp (initial-deposits)))
308 (scroll-text) 308 (scroll-text)
309 (select-menu-entry) 309 (select-menu-entry)
310 (widthdraw-pc-item 0 1) 310 (widthdraw-pc-item 0 1)
311 ;;(widthdraw-pc-item 0 99) 311 ;;(widthdraw-pc-item 0 99)
312 ;;(widthdraw-pc-item 1 1) 312 ;;(widthdraw-pc-item 1 1)
313 (widthdraw-pc-item 2 5) 313 (widthdraw-pc-item 13 255)
314 (close-all-menus)))) 314 (close-all-menus))))
315 315
316 (defn-memo to-celadon 316 (defn-memo to-celadon
317 ([] (to-celadon (restore-items))) 317 ([] (to-celadon (restore-items)))
318 ([script] 318 ([script]
377 ↓ ↓ ↓ 377 ↓ ↓ ↓
378 ← ←]) 378 ← ←])
379 (first-difference [] ↑ AF)))) 379 (first-difference [] ↑ AF))))
380 380
381 (defn talk 381 (defn talk
382 "Assumes that you are facing a person and engages in conversation" 382 "Assumes that you are facing something that initiates text and
383 [[moves state :as script]] 383 causes it to do so."
384 (delayed-difference [] [:a] 100 384 [script]
385 #(aget (memory %) text-address) 385 (->> script
386 script)) 386 (delayed-difference [] [:a] 100
387 387 #(aget (memory %) text-address))))
388 388
389 (defn-memo get-money-floor-two 389 (defn-memo get-money-floor-two
390 ([] (get-money-floor-two (go-to-floor-two))) 390 ([] (get-money-floor-two (go-to-floor-two)))
391 ([script] 391 ([script]
392 (->> script 392 (->> script
560 select-menu-entry 560 select-menu-entry
561 561
562 (scroll-text 6) 562 (scroll-text 6)
563 close-menu))) 563 close-menu)))
564 564
565