Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-12-05 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (93 votes). Check out past polls.