altos/lisp: Make hanoi example output a bit prettier
[fw/altos] / src / test / hanoi.lisp
index 66a8d04bc6b4dbbec4757bf7e59722424ec1e5be..387e696ae55de1df681ce3ff0bc1bac8ed66e92b 100644 (file)
@@ -32,9 +32,7 @@
 
 ; Here's the pieces to display
 
-(setq stack '("*" "**" "***" "****" "*****" "******" "*******"))
-
-(setq top (+ (length stack) 3))
+(setq stack '("     *     " "    ***    " "   *****   " "  *******  " " ********* " "***********"))
 
 ;
 ; Here's all of the stacks of pieces
@@ -55,7 +53,7 @@
               )
         )
        (t (progn
-            (display-string x y "          ")
+            (display-string x y "                    ")
             (display-stack x (1+ y) (1- clear) stack)
             )
           )
@@ -94,6 +92,7 @@
 
 (defun reset-stacks ()
   (setq stacks (list stack nil nil))
+  (setq top (+ (length stack) 3))
   (length stack)
   )
 
        )
   )
 
-(defun nth (list n)
-  (cond ((= n 0) (car list))
-       ((nth (cdr list) (1- n)))
-       )
-  )
-
 ; Replace a stack in the list of stacks
 ; with a new value