# M E A N D E R I N G S T R I N G S
# This main procedure accepts specifications for meandering strings
# from standard input with the alphabet separated from the length by
while line := read() do {
line ? if alpha := tab(upto(':')) then {
if n := integer(tab(0)) then write(meander(alpha,n))
else write("erroneous input")
else write("erroneous input")
procedure meander(alpha,n)
result := repl(alpha[1],t)
if find(result[-t:0] || c,result)
else {result ||:= c; i := k}