diff options
Diffstat (limited to 'ipl/progs/ruler.icn')
-rw-r--r-- | ipl/progs/ruler.icn | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ipl/progs/ruler.icn b/ipl/progs/ruler.icn new file mode 100644 index 0000000..9561de5 --- /dev/null +++ b/ipl/progs/ruler.icn @@ -0,0 +1,35 @@ +############################################################################ +# +# File: ruler.icn +# +# Subject: Program to write a character ruler +# +# Author: Robert J. Alexander +# +# Date: December 5, 1989 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# Write a character ruler to standard output. The first optional +# argument is the length of the ruler in characters (default 80). +# The second is a number of lines to write, with a line number on +# each line. +# + +procedure main(arg) + local length, ruler, lines, i + + length := "" ~== arg[1] | 80 + every writes(right(1 to length / 10,10)) + ruler := right("",length,"----+----|") + if lines := arg[2] then { + write() + every i := 2 to lines do + write(i,ruler[*i + 1:0]) + } + else write("\n",ruler) +end |