Mercurial > vba-clojure
comparison clojure/com/aurellem/gb_driver.clj @ 104:d2e00ea31508
checking in continue!, which let's the GB run for an unlimited time.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 13 Mar 2012 00:03:02 -0500 |
parents | 37711ff4a7bc |
children | 2f8089eacab9 |
comparison
equal
deleted
inserted
replaced
103:3305490a8f62 | 104:d2e00ea31508 |
---|---|
128 (defn play | 128 (defn play |
129 ([^SaveState state n] | 129 ([^SaveState state n] |
130 (reduce (fn [s _] (step s)) state (range n))) | 130 (reduce (fn [s _] (step s)) state (range n))) |
131 ([n] | 131 ([n] |
132 (play @current-state n))) | 132 (play @current-state n))) |
133 | |
134 (defn continue! [] | |
135 (play @current-state Integer/MAX_VALUE)) | |
133 | 136 |
134 (defn play-moves | 137 (defn play-moves |
135 ([moves [prev state]] | 138 ([moves [prev state]] |
136 (set-state! state) | 139 (set-state! state) |
137 (dorun (map (fn [move] (step @current-state move)) moves)) | 140 (dorun (map (fn [move] (step @current-state move)) moves)) |