summaryrefslogtreecommitdiff
path: root/ipl/gpacks/weaving/colorup.icn
blob: 995a65c29654f96d9a6b6e666315b0461ca1fb12 (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
38
39
40
41
42
43
44
45
46
47
48
49
############################################################################
#
#	File:     colorup.icn
#
#	Subject:  Program to produce a weave structure from unravel data
#
#	Author:   Ralph E. Griswold
#
#	Date:     May 26, 1999
#
############################################################################
#
#  This file is in the public domain.
#
#############################################################################
#
#  Input is expected to be the output of unravel -2.
#
#############################################################################
#
#  AD HOC
#
############################################################################

procedure main()
   local warp, weft, pattern, rows, row, i, j

   warp := read() | stop("*** short file")
   weft := read() | stop("*** short file")
   pattern := read() | stop("*** short file")

   write(warp)
   write(weft)

   rows := []

   pattern ? {
      while put(rows, move(*warp))
      }

   every i := 1 to *weft do {
      row := rows[i]
      every j := 1 to *warp do
         if row[j] == warp[j] then writes("1") else writes("0")
      }

   write()

end