comparison clojure/com/aurellem/run/bootstrap_0.clj @ 274:210b465e4720

refactored walking code from buy-initial-objects to its own function.
author Robert McIntyre <rlm@mit.edu>
date Tue, 27 Mar 2012 11:30:58 -0500
parents 3266bd0a6300
children 68f4e87c8f51
comparison
equal deleted inserted replaced
271:3266bd0a6300 274:210b465e4720
16 name-entry-rlm 16 name-entry-rlm
17 scroll-text 17 scroll-text
18 scroll-text 18 scroll-text
19 scroll-text 19 scroll-text
20 scroll-text 20 scroll-text
21 scroll-text 21 scroll-text)))
22 )))
23 22
24 (defn-memo name-rival-bootstrap 23 (defn-memo name-rival-bootstrap
25 ([] (name-rival-bootstrap (to-rival-name))) 24 ([] (name-rival-bootstrap (to-rival-name)))
26 ([script] 25 ([script]
27 (->> script 26 (->> script
395 (end-text) 394 (end-text)
396 (scroll-text 9) 395 (scroll-text 9)
397 (end-text) 396 (end-text)
398 (scroll-text 7) 397 (scroll-text 7)
399 (end-text) 398 (end-text)
400
401 (walk [← ← ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓])))) 399 (walk [← ← ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓]))))
402 400
403 (defn-memo return-to-viridian-mart 401 (defn-memo return-to-viridian-mart
404 ([] (return-to-viridian-mart 402 ([] (return-to-viridian-mart
405 (deliver-oaks-parcel))) 403 (deliver-oaks-parcel)))
406 ([script] 404 ([script]
407 (->> script 405 (->> script
408 oaks-lab->pallet-town-edge 406 oaks-lab->pallet-town-edge
409 (pallet-edge->viridian-mart false)))) 407 (pallet-edge->viridian-mart false))))
408
409 (defn-memo walk-to-counter
410 ([] (walk-to-counter
411 (return-to-viridian-mart)))
412 ([script]
413 (->> script
414 (walk [↑ ↑ ← ←]))))
415
416
417 (defn-memo buy-initial-objects
418 ([] (buy-initial-objects
419 (walk-to-counter)))
420 ([script]
421 (->> script
422 ;(do-nothing 200)
423 (play-moves
424 [[] [:a] []])
425 (scroll-text)
426 (do-nothing 100)
427 (play-moves [[:a]])
428 (do-nothing 100)
429 (play-moves [[:a]])
430 (do-nothing 100)
431 (play-moves [[:a]])
432 (do-nothing 100)
433 (scroll-text)
434 (do-nothing 100)
435 (play-moves [[:a]])
436 (do-nothing 100)
437 (play-moves [[:a]])
438 (do-nothing 100))))
439
440
441
442
443