Hi I have an java project which prints an array using the follwing loop:
However i need to print the array in the shape a figure 8 so that is looks like:Code:String tempString2 = ""; for (int i=0; i<19; i++) { tempString2 = tempString2 + trackSections[i];
Code:[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
I have tried declaring my array like this :
but the array just prints in a straight line.Code:private String [] trackSections= {"","","[..]","","", + '\n' + "","[..]", "","[..]", "" + '\n' + "[..]","","","","[..]", + '\n' + "[..]","","","","[..]", + '\n' + "","[..]", "","[..]", +'\n'+ "","","[..]","","", + '\n'+ "","[..]", "","[..]", "" + '\n' + "[..]","","","","[..]", + '\n' + "[..]","","","","[..]", + '\n' + "","[..]", "","[..]", ""+'\n'+ "","","[..]","","",};
Can anyone help me with this ?
Thanks


Reply With Quote
