Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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?
[choroba]: For my "internal" projects, I just have a thumb drive with --bare clones of the repos
[marto]: too add to my RL to do list: "This USB hard drive is damp, do you think my photos will be ok?"

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-01-23 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (192 votes). Check out past polls.