Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

RE: Generating a Pattern

by japhy (Canon)
on Jul 25, 2000 at 07:39 UTC ( #24241=note: print w/ replies, xml ) Need Help??


in reply to Generating a Pattern

Here's my code:

# fastest my @a = (1); for (1..10) { my $s = @a; while ($s-- and my $e = shift @a) { push @a, 1, $e; $a[-2]++, $s--, shift @a while $a[0] == $e and $s; } } # shortest my @a = (1); for (1..10) { my $i; @a = map $i++ % 2 : length : $_, join("", @a) =~ /((\d)\2*)/g; }


$_="goto+F.print+chop;\n=yhpaj";F1:eval


Comment on RE: Generating a Pattern
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-09-20 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (158 votes), past polls