changeset 74:aaddd7b72a0e

added optional argument to rewind
author Robert McIntyre <rlm@mit.edu>
date Thu, 08 Mar 2012 04:40:18 -0600
parents 8a895ed4c0f9
children eb7d4efe0f34
files clojure/com/aurellem/gb_driver.clj
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb_driver.clj	Thu Mar 08 04:37:10 2012 -0600
     1.2 +++ b/clojure/com/aurellem/gb_driver.clj	Thu Mar 08 04:40:18 2012 -0600
     1.3 @@ -88,7 +88,9 @@
     1.4  
     1.5  (defn clear-history [] (reset! history {}))
     1.6  
     1.7 -(defn rewind [] (goto (dec @current-frame)))
     1.8 +(defn rewind
     1.9 +  ([n] (goto (- @current-frame n)))
    1.10 +  ([] (rewind 1)))
    1.11    
    1.12  (defn backup-state [frame]
    1.13    (swap! history #(assoc % frame (save-state))))