Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 musing on the Monastery: (16)
As of 2015-07-29 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls