blob: a88224b1e03cd525b452a093b6f8083b59177de2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
|