Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

JPEG Zig-Zag

by blackle (Beadle)
on Oct 29, 2012 at 17:07 UTC ( #1001394=obfuscated: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub getPos{
        ($x,$y,$s)=@_;($d=$x+$y)*($d++)/2
        +($d%2?$y:$x)-($d>$s)*($d-$s)**2
    }
    
  2. or download this
    for(my $x = 0; $x < $size; $x++){
        for(my $y = 0; $y < $size; $y++){
    ...
        }
        print "\n";
    }
    
  3. or download this
    0  1  5  6  14  15  27  28  44  45  
    2  4  7  13  16  26  29  43  46  63  
    ...
    35  37  52  57  69  74  82  87  91  96  
    36  53  56  70  73  83  86  92  95  97  
    54  55  71  72  84  85  93  94  98  99
    
  4. or download this
    sub getPos{
        my ($x,$y,$size)=@_;
    ...
            $index -= ($m+1)**2;
        }
    }
    
  5. or download this
    $==pop;print map{$y=$_;map(($d=$y+$_)*$d++/2-($d>$=)*($d-$=)**2+($d&1?
    +$_:$y).$",@m),$/}@m=0..$=-1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://1001394]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-09-03 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls