in reply to Re: (Golf) Fibonacci Strings
in thread (Golf) Fibonacci Strings

This is just a golfing of abstract's neat concept. It comes in at 80 chars. Unfortunately, it allows 'ab' to pass, which it shouldn't. I tried to fix it, but couldn't find a way around the s/^((.)\2{$s})// quotemeta thing.

($_,$r,$s)=(pop,-1,0);($r,$s)=($s,$r+$s+1)while s#^((.)\2{$s})##&&!/^\Q$2\E/;!$_

Replies are listed 'Best First'.
Re: Re: Re: (Golf) Fibonacci Strings
by MeowChow (Vicar) on Jul 20, 2001 at 01:55 UTC
    This will fail for strings like: abaa0. That's why the length test was needed.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print