Mercurial > vba-clojure
comparison clojure/com/aurellem/run/util.clj @ 327:fe6fd2323264
corrected compilation bugs
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 05 Apr 2012 12:59:30 -0500 |
parents | 9637a0f52e7b |
children | 35960b03693f |
comparison
equal
deleted
inserted
replaced
326:8484e6f6db2c | 327:fe6fd2323264 |
---|---|
6 (def ↓ [:d]) | 6 (def ↓ [:d]) |
7 (def ← [:l]) | 7 (def ← [:l]) |
8 (def → [:r]) | 8 (def → [:r]) |
9 | 9 |
10 [↑ ↓ ← →] | 10 [↑ ↓ ← →] |
11 | |
12 (defn do-nothing [n script] | |
13 (->> script | |
14 (play-moves | |
15 (repeat n [])))) | |
11 | 16 |
12 (defn first-difference | 17 (defn first-difference |
13 [base alt difference-metric [moves root :as script]] | 18 [base alt difference-metric [moves root :as script]] |
14 (loop [branch-point root | 19 (loop [branch-point root |
15 actions moves] | 20 actions moves] |
148 (->> | 153 (->> |
149 script | 154 script |
150 (do-nothing 150) | 155 (do-nothing 150) |
151 (play-moves [[:b]])))) | 156 (play-moves [[:b]])))) |
152 | 157 |
153 (defn do-nothing [n script] | |
154 (->> script | |
155 (play-moves | |
156 (repeat n [])))) | |
157 | |
158 (defn delayed-improbability-search | 158 (defn delayed-improbability-search |
159 "insert blank frames before calling script-fn until | 159 "insert blank frames before calling script-fn until |
160 metric returns true." | 160 metric returns true." |
161 [delay metric script-fn script] | 161 [delay metric script-fn script] |
162 (loop [blanks 0] | 162 (loop [blanks 0] |