altos/lisp: Make hanoi example output a bit prettier
authorKeith Packard <keithp@keithp.com>
Wed, 16 Nov 2016 04:37:59 +0000 (20:37 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 20 Feb 2017 19:16:51 +0000 (11:16 -0800)
Make the towers symmetrical instead of lopsided. Much nicer looking.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/test/hanoi.lisp

index aece2ba0d5764bd1215689e6e4e7c4b3c464ad63..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)
   )