diff options
Diffstat (limited to 'ipl/gprogs/randweb.icn')
-rw-r--r-- | ipl/gprogs/randweb.icn | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/ipl/gprogs/randweb.icn b/ipl/gprogs/randweb.icn new file mode 100644 index 0000000..efc6683 --- /dev/null +++ b/ipl/gprogs/randweb.icn @@ -0,0 +1,59 @@ +############################################################################ +# +# File: randweb.icn +# +# Subject: Program to draw random web design +# +# Author: Ralph E. Griswold +# +# Date: May 2, 2001 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# This program connects lines in all possible ways between i randomly +# selected points in a window. The value of i is given on the command +# line (default 20). Large values of i produce unattractively dense +# structures. +# +############################################################################ +# +# Requires: Version 9 graphics +# +############################################################################ +# +# Links: gobject, joinpair, random, wopen +# +############################################################################ + +link gobject +link joinpair +link random +link wopen + +procedure main(argl) + local i, j, k, angle, incr, points, size, radius + + i := integer(argl[1]) | 20 + + size := 300 + radius := size / 2 + + WOpen("label=random web", "width=" || size, "height=" || size) | + stop("*** cannot open window") + + points := [] + + randomize() + + every j := 1 to i do + put(points, Point(?size, ?size)) + + joinpair(points, points) + + Event() + +end |