it prints everythin in a single line.

i tried your code again, it wouldnt print a row. unfortunately. i copied and pasted yoru code. no luck...

how the hell do i print in a row.

damn, should i use a method like tostring? could it give me a chessboard format?


it wouldnt print one shape next to another. not even like that

String row1="";
						    String row2="";
						 for(int x=1;x<9;x++){
							 row1=array[2][x];
							  row2=array[3][x];
						      System.out.print(row1+"  "+row2);
						     
						 }

All i need to do is to print a table from this:
String[][] array=new String[9][9];

but how?

on second thought i think there is no solution to the problem . it wont print me the pieces when there is an array or a single string.

it drops each line automatically.

here is my single string. and before i had it all printed as an array

pawn=" ______ \n |_ _| \n _| |_ \n _| BPawn |_\n |__________|\n";

Only add the newline character: "\n" when everything that needs to be printed on a line has been printed.
There is NO BACKING UP!!!

All i need to do is to print a table from this:
String[][] array=new String[9][9];

but how?

I showed you an example several posts back.

commented: Thanks for your help. This threads has to be closed +0

Norm , it doesnt work. i tried every convoluted way to make it print one column next to another. it doesnt do it..

i think it is because when i break an array and string into bits, it automatically passes a line and keeps doing so..

try to do even this..

pawn=" ______ \n |_ _| \n _| |_ \n _| BPawn |_\n |__________|\n"

put this into both of those

System.out.print(" ______ \n |_ _| \n _| |_ \n _| BPawn |_\n |__________|\n"
)
system.out.print(" ______ \n |_ _| \n _| |_ \n _| BPawn |_\n |__________|\n"
)

it will print only a column, a long one, it will print absolutely nothin next to one another..

i modified my code and i told my string to print only a name instead of a shape made from an array or a Single string.

here is my output

| Brook || Bknight || BBishop || BKing | |BQueen || BBishop || Bknight || Brook |
 | BPawn | | BPawn | | BPawn | | BPawn | | BPawn | | BPawn | | BPawn | | BPawn |
|  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  |
|  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  |
|  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  |
|  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  ||  Null  |
| WPawn | | WPawn |  | BPawn || WPawn | | WPawn | | WPawn | | WPawn | | WPawn | 
| Wrook || Bwhite ||  WBishop || WKing || WQueen ||  WBishop || Bwhite || Wrook |

i will have to be satisfied with that

Ok. Glad to see you got something to work.

pawn=" ______ \n |_ _| \n _| |_ \n _| BPawn |_\n |__________|\n"

Do you see all the \n in this line. Each one advances the output to a new line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.