-; Here's the pieces to display
-
-(setq stack '("*" "**" "***" "****" "*****" "******" "*******"))
-
-(setq top (+ (length stack) 3))
-
-;
-; Here's all of the stacks of pieces
-; This is generated when the program is run
-;
-(setq stacks nil)
-
-; Display one stack, clearing any
-; space above it
-
-(defun display-stack (x y clear stack)
- (cond ((= 0 clear)
- (cond (stack (progn
- (display-string x y (car stack))
- (display-stack x (1+ y) 0 (cdr stack))
+ ; Here's the pieces to display
+
+(define tower '(" * " " *** " " ***** " " ******* " " ********* " "***********"))
+
+ ; Here's all of the towers of pieces
+ ; This is generated when the program is run
+
+(define towers ())
+
+(define one- (lambda (x) (- x 1)))
+(define one+ (lambda (x) (+ x 1)))
+ ; Display one tower, clearing any
+ ; space above it
+
+(define display-tower (lambda (x y clear tower)
+ (cond ((= 0 clear)
+ (cond ((not (null? tower))
+ (display-string x y (car tower))
+ (display-tower x (one+ y) 0 (cdr tower))
+ )
+ )
+ )
+ (else
+ (display-string x y " ")
+ (display-tower x (one+ y) (one- clear) tower)
+ )
+ )