############################################################################ # # File: caprlore.icn # # Subject: Program to expand carpet meta-specifications # # Author: Ralph E. Griswold # # Date: February 22, 1998 # ############################################################################ # # This file is in the public domain. # ############################################################################ # # This program includes a file produced by plorport and expands it into # a sequence of carpet specification files. This format is used by # carpback to creat carpet images in the background. # ############################################################################ # # Links: carputil, xcode # ############################################################################ link carputil link xcode $include "plorincl.icn" procedure main() local i, database, rec i := -1 database := table() rec := carpet() # starting carpet every { c3{ c2{ c1{ wh{ rec.width := Width, rec.height := Height }, mc{ rec.modulus := Modulus, rec.colors := Colors } }, tl{ rec.top := Top, rec.left := Left } }, rec.neighbors := Neighbors } } \ Limit do { rec.name := Name || right(i +:= 1, 3, "0") rec.comments := image(&dateline) rec.links := ["seqfncs"] rec.defns := table() database[rec.name] := rec rec := copy(rec) # keep previous fields ... } xencode(database) # send encoding to standard output end procedure Cross_(L) # called as Cross_{expr1, expr2} while @L[1] do { while @L[2] do suspend L[2] := ^L[2] } end procedure Parallel_(L) # called as Parallel_{expr1, expr2} while @L[1] do { @L[2] | fail suspend } end