[REBOL] Re: Coffee break problem anyone?
From: nitsch-lists:netcologne at: 5-Nov-2003 14:45
Am Mittwoch, 5. November 2003 08:28 schrieb [SunandaDH--aol--com]:
> Thanks to (in order of message receipt at my end) Gabriele, Gabriele,
> Romano, Ladislav, and Joel for showing me better approaches.
>
> Parse is so powerful, I should try to learn to use it for more things that
> just breaking strings apart.
>
Closed? I am to late? I guess its like Joels classic modell:
sparse-array: [12 13 14 15 16 17 18
7 8
20 21 22 23 24 25 26
19
59 58 57 56 55 54 53 52
20 21 22 23
101 102 103 104 105 106 107
]
b: p: sparse-array ;b: begin of run
best-b: none best-l: 0
forall p [
set [n1 n2] p
if 1 + n1 <> n2 [;close run ;and if at end n2 = none ;)
if best-l < l: 1 + subtract index? p index? b [
best-b: b best-l: l
]
b: next p
]
]
? best-b ? best-l
probe copy/part best-b best-l
;Volker