; Illustration of the graphic capabilities of zlisp. ; Alejandro Luque Estepa, 1999 (import "zlisp.LispMath") (import "zlisp.LispGraph") (defun spring nil (prog nil (do ((y 0 (add1 y))) ((> y height) t) (color 0.0 0.0 (/ y (* height 1.0))) (line 0 y width y) ) (do ((j 0 (add1 j)) (x (/ width 2) (round (* (random) width))) (y (/ height 2) (round (* (random) height))) (r 100 (round (* (random) 60)))) ((> j 10) "The End") (color 1.0 1.0 1.0) (do ((a 0 (+ a 0.01))) ((> a (* 2 pi)) "Ok") (line x y (+ x (round (* r (cos a) (cos (* 6 a))))) (+ y (round (* r (sin a) (cos (* 6 a)))))) ) (color 1.0 1.0 0.0) (do ((r2 0 (add1 r2))) ((greaterp r2 (quotient r 4)) "Ok") (circle x y r2) ) ) ) ) (msg "zlisp 0.1 Sample file." t "Write (spring) then switch to graphics mode and click on Eval All" t)