Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How can I print out part of the matrix

by clintp (Curate)
on Jun 02, 2002 at 20:46 UTC ( #171064=note: print w/ replies, xml ) Need Help??


in reply to How can I print out part of the matrix

The question is, do you know how to print the matrix at all? I'm going to assume you can, and if so instead of:

# pseudocode for row (0..rows) { for col (0..cols) { print array[row][col] } }
You substitute a list for the colums and rows you want to iterate over:
# pseudocode for row (@goodrows) { for col (@goodcols) { print array[row][col] } }


As an aside, this is interesting...
@gm=map { [ @$_[@goodcols] ] } @matrix[@goodrows];
Giving a matrix with only the good columns and rows in it. Hmm. Although I'd have preferred some kind of @matrix[@goodrows]->[@goodcols] syntax, but I'll have to wait for Perl 6 for that.


Comment on Re: How can I print out part of the matrix
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2015-07-05 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls