Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re (tilly) 3: alternating row colors

by jeroenes (Priest)
on May 18, 2001 at 20:00 UTC ( [id://81532]=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 3: alternating row colors
in thread alternating row colors

I appreciate tilly's posting so much, that I just had to make figures from it. I modified it a bit to find the maximum offset for various array_lengths. Here are the graphs:
Simple: max_offset 1600 ++----------+----------+-----------+-----------+----------+----- +-----++ + + + + +'/tmp/out.txt'** +***** + 1400 ++ * + ++ | * + | | * + | 1200 ++ * + ++ | * + | 1000 ++ * + ++ | * + | 800 ++ * + ++ | ****** * + | | * ********** * + | 600 ++ * *********** * + ++ | * ****** + | 400 ++ * * + ++ | *********** * + | | * ****** + | 200 ++ ********* + ++ + * **** + * + + + + + + 0 *****-------+----------+-----------+-----------+----------+----- +-----++ 0 100 200 300 400 500 + 600 array_length Better axes: max_offset / array_length 9 ++------+-------+-------+-------+--------+-------+-------+-------+- +-----++ + + + + + + +'/tmp/out2.txt'+* +***** + 8 ++ * + ++ | * * + | | * * + | 7 ++ * * + ++ | * * + | 6 +* * + ++ |* * + | 5 *+ * + ++ | * + | | * + | 4 ++ * + ++ | ** + | 3 ++ * * * ** * * * + ++ | ** ** ** *** ** ** ** + | | * * * * ** * ** **** **** * + | 2 ++ * * ** * *** * ** * ** * *** * + ++ + + + ** *+ ** * ****+ ****+ ** * **** + + 1 ++------+-------+-----**+------**------**+-----**+------**------**- +-----++ 1 2 3 4 5 6 7 8 9 + 10 log2( array_length)
That's clear: a jump at every 2**(1..$n) length of the array. The jump is to 3 times the array_length at the jump. So now we can deduct the perl source code from this {grin}.

There are small deviations due to the poor representation of lines on the ASCII field. For smaller array lengths, this relation does not hold.

Jeroen
"We are not alone"(FZ)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found