diff clojure/com/aurellem/run/bootstrap_0.clj @ 291:c8b0db518de3

script: creating header for initial bootstrap program.
author Robert McIntyre <rlm@mit.edu>
date Thu, 29 Mar 2012 18:23:20 -0500
parents dc9a0060e7cb
children 4a0dbaed7078
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/bootstrap_0.clj	Thu Mar 29 17:38:36 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/bootstrap_0.clj	Thu Mar 29 18:23:20 2012 -0500
     1.3 @@ -697,7 +697,7 @@
     1.4                   ↓ ↓ ↓ ↓ ↓ ↓
     1.5                   ← ← ← ↑]))))
     1.6  
     1.7 -(defn to-poke-center-computer
     1.8 +(defn-memo to-poke-center-computer
     1.9    ([] (to-poke-center-computer
    1.10         (viridian-store->viridian-poke-center)))
    1.11    ([script]
    1.12 @@ -706,4 +706,50 @@
    1.13                   ↑ ↑ ↑
    1.14                   → → → → → → → → → ↑])
    1.15            (do-nothing 1))))
    1.16 -                     
    1.17 +
    1.18 +(defn-memo begin-deposits
    1.19 +  ([] (begin-deposits
    1.20 +       (to-poke-center-computer)))
    1.21 +  ([script]
    1.22 +     (->> script
    1.23 +          ;; access PC
    1.24 +          (scroll-text 2)
    1.25 +
    1.26 +          ;; access item storage
    1.27 +          (menu [[:a] [:d] [:a]])
    1.28 +          (scroll-text 2)
    1.29 +
    1.30 +          ;; begin deposit
    1.31 +          (menu [[:d] [:a]])
    1.32 +          (do-nothing 40))))
    1.33 +
    1.34 +(defn deposit-one-item
    1.35 +  [script]
    1.36 +  (->> script
    1.37 +       (do-nothing 100)
    1.38 +       (play-moves [[:a]])
    1.39 +       (do-nothing 80)
    1.40 +       (play-moves [[:a]])
    1.41 +       (scroll-text)
    1.42 +       ))
    1.43 +
    1.44 +(defn multiple-times
    1.45 +  ([n command args script]
    1.46 +     (reduce (fn [script _]
    1.47 +               (apply command (concat args [script])))
    1.48 +             script
    1.49 +             (range n)))
    1.50 +  ([n command script]
    1.51 +     (multiple-times n command [] script)))
    1.52 +
    1.53 +(defn create-header
    1.54 +  ([] (create-header (begin-deposits)))
    1.55 +  ([script]
    1.56 +     (->> script
    1.57 +          (multiple-times 34 deposit-one-item)
    1.58 +          ;;(deposit-one-item)
    1.59 +          ;;(deposit-one-item)
    1.60 +          (do-nothing 1))))
    1.61 +  
    1.62 +                           
    1.63 +       
    1.64 \ No newline at end of file