diff 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
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/bootstrap_0.clj	Tue Mar 27 00:33:07 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/bootstrap_0.clj	Tue Mar 27 11:30:58 2012 -0500
     1.3 @@ -18,8 +18,7 @@
     1.4           scroll-text
     1.5           scroll-text
     1.6           scroll-text
     1.7 -         scroll-text
     1.8 -         )))
     1.9 +         scroll-text)))
    1.10  
    1.11  (defn-memo name-rival-bootstrap
    1.12    ([] (name-rival-bootstrap (to-rival-name)))
    1.13 @@ -397,7 +396,6 @@
    1.14            (end-text)
    1.15            (scroll-text 7)
    1.16            (end-text)
    1.17 -
    1.18            (walk [← ← ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓]))))
    1.19  
    1.20  (defn-memo return-to-viridian-mart
    1.21 @@ -406,4 +404,40 @@
    1.22    ([script]
    1.23       (->> script
    1.24            oaks-lab->pallet-town-edge
    1.25 -          (pallet-edge->viridian-mart false))))
    1.26 \ No newline at end of file
    1.27 +          (pallet-edge->viridian-mart false))))
    1.28 +
    1.29 +(defn-memo walk-to-counter
    1.30 +  ([] (walk-to-counter
    1.31 +       (return-to-viridian-mart)))
    1.32 +  ([script]
    1.33 +     (->> script 
    1.34 +          (walk [↑ ↑ ← ←]))))
    1.35 +  
    1.36 +       
    1.37 +(defn-memo buy-initial-objects
    1.38 +  ([] (buy-initial-objects
    1.39 +       (walk-to-counter)))
    1.40 +  ([script]
    1.41 +     (->> script
    1.42 +          ;(do-nothing 200)
    1.43 +          (play-moves
    1.44 +           [[] [:a] []])
    1.45 +          (scroll-text)
    1.46 +          (do-nothing 100)
    1.47 +          (play-moves [[:a]])
    1.48 +          (do-nothing 100)
    1.49 +          (play-moves [[:a]])
    1.50 +          (do-nothing 100)
    1.51 +          (play-moves [[:a]])
    1.52 +          (do-nothing 100)
    1.53 +          (scroll-text)
    1.54 +          (do-nothing 100)
    1.55 +          (play-moves [[:a]])
    1.56 +          (do-nothing 100)
    1.57 +          (play-moves [[:a]])
    1.58 +          (do-nothing 100))))
    1.59 +
    1.60 +          
    1.61 +
    1.62 +          
    1.63 +     
    1.64 \ No newline at end of file