############################################################################ # # File: lsysmap.icn # # Subject: Program to map L-system symbols # # Author: Ralph E. Griswold # # Date: June 18, 1998 # ############################################################################ # # This file is in the public domain. # ############################################################################ # # This program maps the symbols in L-Systems. # # The following options are supported: # # -i s input symbols for mapping; default &ucase # -o s output symbols for mapping; default &ucase # -a put symbols for axiom production in alphabetical # order (ignores -i and -o) # # symbol strings are given on the command line, as in # # lsysmap -i ABCD -o DCBA ") then symbols ++:= move(1) } } isyms := deletec(isyms, &cset -- symbols) isyms := ochars(isyms) osyms := csort(isyms) every i := 1 to *defs do { defs[i] ?:= { (="axiom:" || map(move(1), isyms, osyms)) | (find("->") & map(tab(0), isyms, osyms)) | tab(0) } } every write(!defs) end