summaryrefslogtreecommitdiff
path: root/ipl/progs/scale.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/progs/scale.icn')
-rw-r--r--ipl/progs/scale.icn37
1 files changed, 37 insertions, 0 deletions
diff --git a/ipl/progs/scale.icn b/ipl/progs/scale.icn
new file mode 100644
index 0000000..a88224b
--- /dev/null
+++ b/ipl/progs/scale.icn
@@ -0,0 +1,37 @@
+############################################################################
+#
+# File: scale.icn
+#
+# Subject: Program to scale numeric values in visualization stream
+#
+# Author: Ralph E. Griswold
+#
+# Date: January 20, 1999
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# This program scales the numerical channel of a visualization stream.
+# It leaves color channel alone, if there is one. Scale factor is
+# given on command line; default 10.
+#
+# Note: This program can be used on a numerical stream.
+#
+############################################################################
+
+procedure main(args)
+ local factor, line, i
+
+ factor := \args[1] | 10
+
+ while line := read() do {
+ line ? {
+ i := tab(upto(' \t') | 0)
+ write(i * factor, tab(0))
+ }
+ }
+
+end