diff clojure/com/aurellem/title.clj @ 88:65c2854c5875

can now save moves and states and am ready to continue past the title
author Robert McIntyre <rlm@mit.edu>
date Sat, 10 Mar 2012 15:36:26 -0600
parents e8855121f413
children 2f478abe57d0
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/title.clj	Sat Mar 10 14:48:17 2012 -0600
     1.2 +++ b/clojure/com/aurellem/title.clj	Sat Mar 10 15:36:26 2012 -0600
     1.3 @@ -25,14 +25,14 @@
     1.4  
     1.5  (defn start [] [[] (root)])
     1.6  
     1.7 -(defn-memo title [start]
     1.8 -  (->> start
     1.9 +(defn-memo title []
    1.10 +  (->> (start)
    1.11         (advance [] [:a])
    1.12         (advance [] [:start])
    1.13         (advance [] [:a])
    1.14         (advance [] [:start])))
    1.15  
    1.16 -(defn-memo oak [start]
    1.17 +(defn-memo oak []
    1.18    (->> (title)
    1.19         scroll-text
    1.20         scroll-text
    1.21 @@ -83,8 +83,19 @@
    1.22         scroll-text
    1.23         scroll-text))
    1.24  
    1.25 -(defn-memo intro []
    1.26 -  (-> (start) title oak name-entry rival-name-entry finish-title))
    1.27 +(defn write-intro! []
    1.28 +  (let [[moves state] (finish-title)]
    1.29 +    [(write-moves! moves) (write-state! state)]))
    1.30 +
    1.31 +(def title-frames 2323)
    1.32 +
    1.33 +(defn intro []
    1.34 +  [(read-moves title-frames)
    1.35 +   (read-state title-frames)])
    1.36 +
    1.37 +(defn test-intro []
    1.38 +  (play-vbm (moves->filename title-frames)))
    1.39 +
    1.40  
    1.41  
    1.42  ;; TODO might be able to glue these together more elegantly with monads