23 lines
496 B
Text
23 lines
496 B
Text
integer fn = open(command_line()[2],"r") -- (reading the source file)
|
|
|
|
function allx(string line)
|
|
line[1..-1] = 'x'
|
|
return line
|
|
end function
|
|
|
|
function longest(string mask)
|
|
object line = gets(fn)
|
|
string newmask
|
|
if atom(line) then return mask end if
|
|
newmask = allx(line)
|
|
if not match(mask,newmask) then return longest(mask) end if
|
|
mask = longest(newmask)
|
|
if match(mask,newmask) then
|
|
puts(1,line)
|
|
end if
|
|
return mask
|
|
end function
|
|
|
|
?longest("x")
|
|
|
|
close(fn)
|