Mercurial > vba-clojure
view clojure/com/aurellem/run/title.clj @ 573:40f62391db9d
implemented row and column increment logic.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 01 Sep 2012 03:56:30 -0500 |
parents | abd1ca8a25cc |
children |
line wrap: on
line source
1 (ns com.aurellem.run.title2 (:use (com.aurellem.gb gb-driver vbm))3 (:use (com.aurellem.run util)))5 (defn start [] [[] (root)])7 (defn-memo title8 ([] (title (start)))9 ([script]10 (->> script11 (first-difference [] [:a] AF)12 (first-difference [] [:start] AF)13 (first-difference [] [:a] AF)14 (first-difference [] [:start] AF))))16 (defn-memo oak17 ([] (oak (title)))18 ([script]19 (->> script20 (scroll-text 13))))22 (defn-memo name-entry-rlm23 ([] (name-entry-rlm (oak)))24 ([script]25 (->> script26 (first-difference [] [:a] AF)27 (first-difference [] [:r] DE)28 (play-moves29 [[]30 [:r] [] [:r] [] [:r] [] [:r] []31 [:r] [] [:r] [] [:r] [] [:d] [:a]32 [:l] [] [:l] [] [:l] [] [:l] []33 [:l] [] [:l] [:a] [] [:r] [:a]34 [:r] [] [:r] [] [:r] [] [:r] []35 [:r] [] [:d] [] [:d] [] [:d] [:a]]))))37 (defn-memo name-entry-ash38 ([] (name-entry-ash (oak)))39 ([script]40 (->> script41 (first-difference [] [:d] AF)42 (first-difference [] [:d] AF)43 (first-difference [] [:a] AF))))45 (defn-memo rival-name-entry-gary46 ([] (rival-name-entry-gary (name-entry-ash)))47 ([script]48 (->> script49 (scroll-text 5)50 (first-difference [] [:d] AF)51 (first-difference [] [:d] AF)52 (first-difference [] [:a] AF))))54 (defn-memo rival-name-entry-blue55 ([] (rival-name-entry-blue (name-entry-ash)))56 ([script]57 (->> script58 (scroll-text 5)59 (first-difference [] [:d] AF)60 (first-difference [] [:a] AF))))62 (defn-memo finish-title63 ([] (finish-title (rival-name-entry-blue)))64 ([script]65 (->> script66 (scroll-text 7))))68 (def title-frames 2194)70 (defn title-checkpoint! []71 (let [[moves state] (finish-title)]72 (assert (= title-frames (count moves)))73 [(write-moves! moves "title-checkpoint")74 (write-state! state "title-checkpoint")]))76 (defn intro []77 [(read-moves "title-checkpoint")78 (read-state "title-checkpoint")])80 ;;(defn test-intro []81 ;; (play-vbm (moves-filename "title-checkpoint")))83 ;; TODO might be able to glue these together more elegantly with monads