home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
OL.LZH
/
PROCS.LZH
/
GENER.ICN
< prev
next >
Wrap
Text File
|
1991-07-13
|
1KB
|
45 lines
############################################################################
#
# Name: gener.icn
#
# Title: Generate miscellaneous sequences
#
# Author: Ralph E. Griswold
#
# Date: June 10, 1988
#
############################################################################
#
# These procedures generate sequences of results.
#
# hex() sequence of hexadecimal codes for numbers
# from 0 to 255
#
# label(s,i) sequence of labels with prefix s starting at
# i
#
# octal() sequence of octal codes for numbers from 0 to
# 255
#
# star(s) sequence consisting of the closure of s
# starting with the empty string and continuing
# in lexical order as given in s
#
############################################################################
procedure hex()
suspend !"0123456789abcdef" || !"0123456789abcdef"
end
procedure label(s,i)
suspend s || (i | (i +:= |1))
end
procedure octal()
suspend (0 to 3) || (0 to 7) || (0 to 7)
end
procedure star(s)
suspend "" | (star(s) || !s)
end