X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftest%2Fhanoi.lisp;h=e2eb0fa00854dd3732496ca02e210feb8d142fc5;hb=97cf9df882291b9e494b2f64f84eb37357a6ab31;hp=b5f2d0f5b3099ff639898a8870f576f028c17904;hpb=2cc8ca2b781be0a6e7ce14405eb4611bc00a3a3e;p=fw%2Faltos diff --git a/src/test/hanoi.lisp b/src/test/hanoi.lisp index b5f2d0f5..e2eb0fa0 100644 --- a/src/test/hanoi.lisp +++ b/src/test/hanoi.lisp @@ -17,11 +17,11 @@ ; ANSI control sequences (defun move-to (col row) - (patom "\033[" row ";" col "H" nil) + (patom "\033[" row ";" col "H") ) (defun clear () - (patom "\033[2J" nil) + (patom "\033[2J") ) (defun display-string (x y str) @@ -112,6 +112,8 @@ ; Move a piece from the top of one stack ; to the top of another +(setq move-delay 100) + (defun move-piece (from to) (let ((from-stack (nth stacks from)) (to-stack (nth stacks to)) @@ -121,7 +123,7 @@ (setq stacks (replace stacks from from-stack)) (setq stacks (replace stacks to to-stack)) (display) - (delay 100) + (delay move-delay) ) ) @@ -149,4 +151,5 @@ (clear) (_hanoi len 0 1 2) (move-to 0 23) + t )