#!/usr/bin/newlisp
; petals.lsp - L.M. July 2006
(load "postscript.lsp")
(set ' colors '(
"800000" "800080" "8000FF" "808000"
"808080" "8080FF" "80FF00" "80FF80"
"80FFFF" "FF0000" "FF0080" "FF00FF"
"FF8000" "FF8080" "FF80FF" "FFFF00"))
; Background
(ps:goto 0 0)
(ps:fill-color 0.0 0.0 0.2)
(ps:shape '((0 792) (90 612) (90 792) (90 612)) true)
;; Flower
(define (flower x y width height color)
(ps:fill-color color)
(ps:goto x y)
(dotimes (i 24)
(ps:petal width height true)
(ps:turn 15))
(ps:fill-color (random) (random) 0)
(ps:circle (div height 8) true))
(dotimes (i 400)
(set 'height (amb 15 15 20 20 50 50 50 80 100))
(set 'width (div height (amb 2 3 3 4 4 4 5 6)))
(flower (rand 612) (rand 792)
width
height
(colors (rand 16))))
; Signature
(ps:line-color 0.9 0.9 0.9)
(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