0

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?

Edited by NewOrder: n/a

0

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";

1

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.

Edited by NormR1: n/a

Votes + Comments
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

0

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.

Edited by NormR1: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.