summaryrefslogtreecommitdiff
path: root/ipl/gprogs/fractlin.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/gprogs/fractlin.icn')
-rw-r--r--ipl/gprogs/fractlin.icn78
1 files changed, 78 insertions, 0 deletions
diff --git a/ipl/gprogs/fractlin.icn b/ipl/gprogs/fractlin.icn
new file mode 100644
index 0000000..c9a3639
--- /dev/null
+++ b/ipl/gprogs/fractlin.icn
@@ -0,0 +1,78 @@
+############################################################################
+#
+# File: fractlin.icn
+#
+# Subject: Program to demonstrate fractal lines
+#
+# Author: Stephen Wampler
+#
+# Date: August 3, 2000
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# Version: 1.0
+#
+############################################################################
+#
+#
+# Comments: This program shows how fractal lines work.
+#
+# See the procedure 'helpmsg' for command line options
+#
+# Waits for a window event before closing window
+#
+############################################################################
+#
+# Links: glib, wopen
+#
+############################################################################
+#
+# Requires: Version 9 graphics and co-expressions (for glib.icn)
+#
+############################################################################
+
+link glib
+link wopen
+
+global win, mono, h, w
+global Window, XMAX, YMAX
+
+procedure main (args)
+ local nextarg, arg, i
+
+ XMAX := YMAX := 700 # physical screen size
+ w := h := 1.0
+
+ nextarg := create !args
+ while arg := @nextarg do {
+ if arg == ("-help"|"-h") then stop(helpmsg())
+ }
+
+ win := WOpen("label=Fractal Lines", "width="||XMAX, "height="||YMAX)
+ mono := WAttrib (win, "depth") == "1"
+ Window := set_window(win, point(0,0), point(w,h),
+ viewport(point(0,0), point(XMAX, YMAX), win))
+
+ EraseArea(win)
+
+ Fg(win, "black")
+
+ every i := 1 to 10 do {
+ fract_line(Window, point(0.25,0.25), point(0.50,0.67), i/10.0)
+ fract_line(Window, point(0.50,0.67), point(0.75,0.25), i/10.0)
+ fract_line(Window, point(0.75,0.25), point(0.25,0.25), i/10.0)
+ }
+
+ Event(win)
+ close(win)
+end
+
+procedure helpmsg()
+ write("Usage: Fract")
+ return
+end
+