Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Storing variable coordinates in a matrix

by davidrw (Prior)
on Mar 15, 2007 at 16:46 UTC ( #605020=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub makeBoxArray {
      my ($x, $y) =  @_;
    ...
    # use @A for something
    @A = makeBoxArray( 7, 2 );
    # use @A for something
    
  2. or download this
    sub makeBoxArray {
      my $left = shift;
    ...
          [ map { [$left+$_, $top+$y] } 0 .. $width-1 ]
        } 0 .. $height-1 ;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2021-12-07 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (33 votes). Check out past polls.

    Notices?