1 ;; DRAGON.L FOR PC-LISP V2.10
2 ;; Modified for xlisp 2.1d (w. graphics extensions) by Tom Almy
3 ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~
4 ;; Draw an Nth order Dragon Curve requires Turtle.l routines to run.
5 ;; Taken From Byte April 1986. Try (DragonCurve 16) then put on supper,
6 ;; watch the news and come back in an hour and see the results. It takes
7 ;; about 1/2 hour on my machine so on a normal IBM-PC it should take about
10 ;; Peter Ashwood-Smith.
13 ;; P.S - This dragon is nicknamed "spot"
15 #-
:turtle
(load "turtle")
19 (defun Dragon(sign level
)
21 (TurtleForward *StepSize
*)
23 (setq level
(1- level
))
24 (TurtleRight (* 45 sign
))
26 (TurtleLeft (* 90 sign
))
28 (TurtleRight (* 45 sign
))
33 (defun DragonCurve (n m
)
34 (setq *StepSize
* m
) ; *StepSize* is global variable
38 (TurtleRight 30) ; angle the serpent a bit
43 (print "Try (DragonCurve 14 1)")