Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: (Golf) Fibonacci Strings

by MeowChow (Vicar)
on Jul 21, 2001 at 01:38 UTC ( [id://98550]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub is_fibo {
      $_=pop;$n=0;{/^|(.)\1*/g?$n^($c=length$&)?0:($n=1-$c+pos,redo):$n>2}
    }
    
  2. or download this
    sub is_fibo {
      $_=pop;$n=1;{/(.)\1*/g?$n^($c=length$&)?0:($n=1-$c+pos,redo):$n>2}
    }
    
  3. or download this
    sub is_fibo {
       $_=pop;$n=0;$p=1;{/(.)\1*/g?pos^$n?0:($n+=$p+1,$p=pos,redo):$p>2}
    }
    
  4. or download this
    sub is_fibo {
      $n=0;pop=~/^((.)(??{"\Q$2"x$n})(?!\2)(?{$n=-++$n+pos})){3,}$/
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://98550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-19 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found