Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
procedure main(arglist)
|
||||
local b # the current buffer (string)
|
||||
local l # the last string
|
||||
local L # a \n delimited accumulation of all the longest strings
|
||||
|
||||
while b := read() do {
|
||||
/l := b # primes l on first pass
|
||||
b ? ( move(*l), if move(1) then L := (l := b) || "\n" else if move(0) then L := (\L|"") || b || "\n")
|
||||
# move(*l) - fails if b is not l characters long
|
||||
# move(1) - succeeds/fails if the string is longer and triggers a reset of L
|
||||
}
|
||||
|
||||
write(\L)
|
||||
end
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
procedure main()
|
||||
longest(".") # needs a single character seed to throw away
|
||||
end
|
||||
|
||||
procedure longest(Longest)
|
||||
Line := read() | return Longest # read until we can return the longest strings
|
||||
if Line[*Longest] then Longest := Line # prime/reset Longest
|
||||
Longest := longest(Longest) # use stack to hold multiples
|
||||
if Line[*Longest] then write(Line) # write only longest strings,
|
||||
# Line must be at least as long as Longest
|
||||
return Longest # feed back longest for length
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue