Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: how to printf a matrix like this

by McA (Priest)
on Feb 11, 2014 at 11:09 UTC ( #1074386=note: print w/ replies, xml ) Need Help??


in reply to how to printf a matrix like this

Hi,

IMHO the most generic approach would be to store the result matrix into an array of arrays. While doing so, you could remember the most needed space for a column. After that you know the minimum space for each column and the adjustment needed when printing. After that you print each row of the array of arrays knowing how to adjust the length of the output.

Regards
McA

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2016-07-28 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (258 votes). Check out past polls.