diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 23:51:56 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 23:51:56 +0000 |
commit | 6ab0c0f5bf14ed9c15370407b9ee7e0b4b089ae1 (patch) | |
tree | 926065cf45450116098db664e3c61dced9e1f21a /ipl/gprogs/rolypoly.icn | |
download | icon-6ab0c0f5bf14ed9c15370407b9ee7e0b4b089ae1.tar.gz |
Initial upstream version 9.4.3upstream/9.4.3
Diffstat (limited to 'ipl/gprogs/rolypoly.icn')
-rw-r--r-- | ipl/gprogs/rolypoly.icn | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/ipl/gprogs/rolypoly.icn b/ipl/gprogs/rolypoly.icn new file mode 100644 index 0000000..2c2011f --- /dev/null +++ b/ipl/gprogs/rolypoly.icn @@ -0,0 +1,62 @@ +############################################################################ +# +# File: rolypoly.icn +# +# Subject: Program to draw ``abstract'' art +# +# Author: Ralph E. Griswold +# +# Date: September 28, 1997 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# This program makes a simple random abstract sketch. It supports these +# options: +# +# -p i number of points (default 10) +# -s i size of (square) window (default 300) +# -r randomize seed +# +############################################################################ +# +# Requires: Version 9 graphics +# +############################################################################ +# +# Links: random, options, gobject, randfigs, wopen +# +############################################################################ + +link random +link options +link gobject +link randfigs +link wopen + +procedure main(argl) + local opts, n, size, points, p + + opts := options(argl, "p+s+r") + + n := \opts["p"] | 10 + size := \opts["s"] | 300 + if \opts["r"] then randomize() + + WOpen("label=rolypoly", "size=" || size || "," || size) | + stop("*** cannot open window") + + points := [] # list of x,y coordinates + + every p := random_points(size, size) \ n do + every put(points, \!p) # z coordinate is null + + # here's the fun + every (FillPolygon | DrawCurve) ! points + + Event() # hold window open for an event + +end |