Mercurial > vba-clojure
view clojure/com/aurellem/run/bootstrap_0.clj @ 255:d9e0752da684
unicode walking :)
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 26 Mar 2012 06:00:30 -0500 |
parents | b7f682bb3090 |
children | 8d1a354f7471 |
line wrap: on
line source
1 (ns com.aurellem.run.bootstrap-02 (:use (com.aurellem.gb gb-driver vbm))3 (:use (com.aurellem.run title save-corruption))4 (:use (com.aurellem.exp item-bridge)))7 (defn-memo boot-root []8 [ [] (root)])10 (defn-memo to-rival-name11 ([] (to-rival-name (boot-root)))12 ([script]13 (-> script14 title15 oak16 name-entry-rlm17 scroll-text18 scroll-text19 scroll-text20 scroll-text21 scroll-text22 )))24 (defn-memo name-rival-bootstrap25 ([] (name-rival-bootstrap (to-rival-name)))26 ([script]27 (->> script28 (advance [] [:a])29 (advance [] [:r] DE)30 (play-moves31 [[]32 [:r] [] [:r] [] [:r] [] [:r] []33 [:r] [] [:r] [] [:r] [] [:d] []34 [:d] [:a] ;; space35 [:l] [] [:d] [:a] ;; [PK]36 [:u] [] [:u] [] [:u] [] [:l] [:a] ;; G37 [:d] [] [:d] [] [:d] [] [:r] [:a] ;; [PK]38 [:u] [] [:u] [] [:u] [] [:l] [:a] ;; G39 [:d] [] [:d] [] [:d] [] [:r] [:a] ;; [PK]41 [:d] [] [:r] [:a] ;; finish42 ]))))44 (defn walk45 "Move the character along the given directions."46 [directions script]47 (reduce (fn [script direction]48 (move direction script))49 script directions))51 (def ↑ [:u])52 (def ↓ [:d])53 (def ← [:l])54 (def → [:r])56 (defn-memo leave-house57 ([] (leave-house (name-rival-bootstrap)))58 ([script]59 (->> script60 finish-title61 start-walking62 walk-to-stairs63 walk-to-door64 (walk [↓ ↓]))))66 (defn-memo to-pallet-town-edge67 ([] (to-pallet-town-edge (leave-house)))68 ([script]69 (->> script70 start-walking71 (walk [→ → → → →72 ↑ ↑ ↑ ↑ ↑ ↑]))))