summaryrefslogtreecommitdiff
path: root/ipl/procs/weavgenr.icn
blob: d5f888b321eaab3f65281e00fc856904a6739ae7 (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
50
############################################################################
#
#	File:     weavgenr.icn
#
#	Subject:  Links to procedures related to sequence drafting
#
#	Author:   Ralph E. Griswold
#
#	Date:     August 3, 2000
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  AD HOC
#
############################################################################
#
#  Links:  random
#
############################################################################

link random

procedure shaftmap(s)			#: produce shaft map for characters
   local j, map_table

   map_table := table()

   j := 0

   every /map_table[!s] := (j +:= 1)

   return map_table

end

procedure genshafts(s, tbl)		#: generate shafts for string mapping

   suspend tbl[!s]

end

procedure genmapshafts(s1, s2)		#: map string and generate shafts

   suspend genshafts(s1, shaftmap(s2))

end