Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

RE: Generating a Pattern

by turnstep (Parson)
on Jul 25, 2000 at 05:04 UTC ( [id://24223]=note: print w/replies, xml ) Need Help??


in reply to Generating a Pattern

Here's how I did it. Have no idea how this does on time.

#!perl $total=10; ## Set to 1000 and watch your memory drain away! :) @a=qw(1); for (1..$total) { print "@a\n"; my @all; $count=1; $x=0; { if ($a[$x] != $a[$x+1]) { push(@all, $count); push(@all, $a[$x]); $count=0; } last unless ++$count and $a[$x++]; redo; } *a=\@all; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-25 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found