| Author |
How do i print a table with multidimensional array.
|
Dmitri Makovetskiy
Ranch Hand
Joined: Jun 21, 2010
Posts: 128
|
|
Here is my array:
board(pieces,drawNull,4);
board(pieces,drawNull,3);
i created a method to print one column:
how can i print one column next to another?
|
 |
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 2535
|
|
|
I'm not really sure what you're doing with printing lines there ... "_________" for example ... but generally, you'd want to have two nested for loops. The idea is: for each rank, print out the pieces at each file in that rank, then print a new line, then go to then next rank. (Rank = row, file = column.)
|
 |
Dmitri Makovetskiy
Ranch Hand
Joined: Jun 21, 2010
Posts: 128
|
|
Greg Charles wrote:I'm not really sure what you're doing with printing lines there ... "_________" for example ... but generally, you'd want to have two nested for loops. The idea is: for each rank, print out the pieces at each file in that rank, then print a new line, then go to then next rank. (Rank = row, file = column.)
i solved the problem
here is my algorithm
and here is my table
thanks for this site , for helping me for the umteenth time
|
 |
 |
|
|
subject: How do i print a table with multidimensional array.
|
|
|