>>716 Pharo/Squeak Smalltalk
| map next seq start |
map := '.*...**.*.***..' asArray collect: [:x | (x = $*) asBit].
seq := OrderedCollection with: map.
next := [ | acc |
acc := map + (map allButFirst, {0}) + ({0}, map allButLast).
((#(1 2) collect: [:x | acc collect: [:elem | (elem = x) asBit]]) * {map negated + 1. 1}) sum
].
[(start := seq indexOf: (map := next value)) > 0 or: [seq size >= 100]] whileFalse: [seq add: map].
(start = 0 or: [start = seq size]) ifTrue: [seq size] ifFalse: [start to: seq size]
"=> (62 to: 63) "
| map next seq start |
map := '.*...**.*.***..' asArray collect: [:x | (x = $*) asBit].
seq := OrderedCollection with: map.
next := [ | acc |
acc := map + (map allButFirst, {0}) + ({0}, map allButLast).
((#(1 2) collect: [:x | acc collect: [:elem | (elem = x) asBit]]) * {map negated + 1. 1}) sum
].
[(start := seq indexOf: (map := next value)) > 0 or: [seq size >= 100]] whileFalse: [seq add: map].
(start = 0 or: [start = seq size]) ifTrue: [seq size] ifFalse: [start to: seq size]
"=> (62 to: 63) "