summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-15 20:37:59 -0800
committerKeith Packard <keithp@keithp.com>2016-11-17 22:18:39 -0800
commitf144d04fce0ba0cee4bf194518f5959e8ef95405 (patch)
tree251b5de4b7c869cbb4d603fd355ad599eb417a8b
parent1e90df9df37f8ccfe029dcf3e3dc3905779c378b (diff)
altos/lisp: Make hanoi example output a bit prettier
Make the towers symmetrical instead of lopsided. Much nicer looking. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/test/hanoi.lisp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/hanoi.lisp b/src/test/hanoi.lisp
index aece2ba0..387e696a 100644
--- a/src/test/hanoi.lisp
+++ b/src/test/hanoi.lisp
@@ -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)
)