diff clojure/com/aurellem/run/bootstrap_0.clj @ 293:4a0dbaed7078

preliminary idea for a better pre-bootstrapping program.
author Robert McIntyre <rlm@mit.edu>
date Fri, 30 Mar 2012 18:14:14 -0500
parents c8b0db518de3
children 659a9c84c785
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/bootstrap_0.clj	Thu Mar 29 18:23:20 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/bootstrap_0.clj	Fri Mar 30 18:14:14 2012 -0500
     1.3 @@ -723,15 +723,6 @@
     1.4            (menu [[:d] [:a]])
     1.5            (do-nothing 40))))
     1.6  
     1.7 -(defn deposit-one-item
     1.8 -  [script]
     1.9 -  (->> script
    1.10 -       (do-nothing 100)
    1.11 -       (play-moves [[:a]])
    1.12 -       (do-nothing 80)
    1.13 -       (play-moves [[:a]])
    1.14 -       (scroll-text)
    1.15 -       ))
    1.16  
    1.17  (defn multiple-times
    1.18    ([n command args script]
    1.19 @@ -742,13 +733,27 @@
    1.20    ([n command script]
    1.21       (multiple-times n command [] script)))
    1.22  
    1.23 -(defn create-header
    1.24 +(defn deposit-n-items
    1.25 +  [n script]
    1.26 +  (->> script
    1.27 +       (do-nothing 100)
    1.28 +       (play-moves [[:a]])
    1.29 +       (do-nothing 80)
    1.30 +       (multiple-times
    1.31 +        (dec n)
    1.32 +        (fn [script]
    1.33 +          (->> script
    1.34 +               (play-moves [[:u]])
    1.35 +               (do-nothing 1))))
    1.36 +       (play-moves [[:a]])
    1.37 +       (scroll-text)))
    1.38 +      
    1.39 +
    1.40 +(defn-memo create-header
    1.41    ([] (create-header (begin-deposits)))
    1.42    ([script]
    1.43       (->> script
    1.44 -          (multiple-times 34 deposit-one-item)
    1.45 -          ;;(deposit-one-item)
    1.46 -          ;;(deposit-one-item)
    1.47 +          (multiple-times 33 deposit-one-item)
    1.48            (do-nothing 1))))
    1.49    
    1.50