#!/usr/bin/newlisp

; people.lsp - L.M. July 2006

(load "postscript.lsp")

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

(set 'pi (mul (acos 0) 2))

; Man
(define (man size)
	(ps:gsave)
	(ps:translate)
	(ps:scale size size)
	(ps:goto  0 0)
	(ps:shape '(
               (0 100) (-135 50) (90 10) (90 60)
			   (45 28) (45 60) (90 10) (90 50) (-135 100)
               (90 12) (90 60) (-90 4) (-90 60) (90 12) 
	) true)

	(ps:move 115)
	(ps:turn 90)
	(ps:move 14)
	(ps:turn -90)
	(ps:move 20)
	(ps:fill-color (random) (random) (random))
	(ps:circle 20 true)
	(ps:grestore)
)


;; Flower
(define (flower width height)
	(dotimes (i 12)
		(ps:petal width height true)
		(ps:turn 30))
)

; fill sky with shapes
(dotimes (i 50)
	(ps:goto (rand 612) (rand 792))
	(ps:angle (rand 360))
	(ps:fill-color (random 0 0.4) (random 0 0.1) (random 0 0.0))
	(amb 
		(ps:circle (+ (rand 60) 5) true) 
		(ps:polygon (+ (rand 60) 5) (+ 3 (rand 4)) true)
		(flower (+ 5 (rand 20)) (rand 30) true))
)

; earth
(ps:fill-color 0.02 0.10 0.0)
(ps:goto 300 10)
(ps:circle 350 4 true)

; populate it
(dotimes (i 800)
	(ps:goto 300 0)
	(ps:angle (- (rand 180) 90))
	(ps:move (rand 792))
	(ps:fill-color (random) (random) (random))
	(man (div (random) 2)))
(ps:goto 300 0)
(ps:fill-color 1 1 0)
(ps:circle 20 true)


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

(ps:render)

(exit)



syntax highlighting with newLISP and syntax.cgi