comparison clojure/com/aurellem/run/save_corruption.clj @ 313:8e63b0bb8ea3

major refactoring; made (walk) more robust
author Robert McIntyre <rlm@mit.edu>
date Mon, 02 Apr 2012 10:58:16 -0500
parents 8d1a354f7471
children 9a4d3f801c89
comparison
equal deleted inserted replaced
305:7998b1cf18cf 313:8e63b0bb8ea3
1 (ns com.aurellem.run.save-corruption 1 (ns com.aurellem.run.save-corruption
2 (:use (com.aurellem.gb gb-driver vbm)) 2 (:use (com.aurellem.gb gb-driver vbm))
3 (:use (com.aurellem.run title))) 3 (:use (com.aurellem.run title)))
4 4
5 (use 'clojure.repl)
6
7 (defn-memo start-walking 5 (defn-memo start-walking
8 ([script] 6 ([script]
9 (->> script 7 (->> script
10 (advance [:b] [:b :r]))) 8 (advance [:b] [:b :r])))
11 ([] (start-walking (finish-title)))) 9 ([] (start-walking (finish-title))))
12 10
13 (def move
14 (partial advance []))
15
16 (defn-memo walk-to-stairs 11 (defn-memo walk-to-stairs
17 ([] (walk-to-stairs (start-walking))) 12 ([] (walk-to-stairs (start-walking)))
18 ([script] 13 ([script]
19 (->> script 14 (->> script
20 (move [:u]) 15 (move [:u])