; spirals.lsp - L.M. July 2006-11

(load "postscript.lsp")

; Background
(ps:goto 0 0)
(ps:fill-color 0.0 0.15 0.15)
(ps:shape '((0 792) (90 612) (90 792) (90 612)) true)

(ps:line-join 2)
(ps:line-width 1)

; random spirals
(define (spirals n)
	(dotimes (i n)
		(ps:line-color (random) (random) 0.3)
		(ps:goto 306 396)
		(ps:angle (rand 360))
		(spiral (+ (rand 40) 10))
))

; the spiral
(define (spiral len)
	(when (> len 2)
		(ps:turn 15)
		(ps:draw len)
		(spiral (div len 1.05))))

(spirals 200)

; Signature
(ps:line-color 0.5 0.5 0.5)
(ps:goto 425 10)
(ps:angle 90)
(ps:font "Helvetica" 10)
(ps:text "made with newLISP and postscript.lsp")

; for Mac OS X
(ps:render)

; UNIX and Win32
;(ps:save "myfile.ps")

(exit)



syntax highlighting with newLISP and syntax.cgi