Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: Generating a Pattern

by hawson (Monk)
on Jul 27, 2000 at 00:47 UTC ( #24566=note: print w/ replies, xml ) Need Help??


in reply to Generating a Pattern

Here's mine:

#!/usr/local/bin/perl @a=split(//,"1"); #easier to make test strings this way. :) for (1..10) { print "@a\n"; @b=(); $a=join("",@a); while ( $a =~ /((.)\2*/cg ) { push (@b, (length $1, $2)); } @a=@b }
500 iterations of this took 1.15 seconds. 10 iterations running 1..35 took 18.73 seconds. For reference, I'm running this on an Ultrasparc-5.


Comment on RE: Generating a Pattern
Download Code
RE: RE: Generating a Pattern
by japhy (Canon) on Jul 27, 2000 at 22:44 UTC
    That is more or less identical to my regex solution. Very nice, though.

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2014-09-21 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (173 votes), past polls