Originally Posted by
helloworld922
I can't clearly make out what the assignment is based off of the image you posted, but it looks like you're missing all the spaces.
I changed by my code im having problems with including the stars into the code, it prints everything else
public class LicolnField2 {
private static final String dot = ".";
private static final String frontDashes = "_/";
private static final String lastDashes = "\\_";
private static final String topLines = "_";
private static final String sideLines = "|";
private static final String stars = "********";
private static final String space = " ";
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// print top line
for(int j = 0; j < 36; j++)
{
System.out.print("_");
}
System.out.println("");
// loop for expanding triangle
for(int row = 1; row < 9; row++)
{
int firstRowDots = 2;
int numDots = 4*row - firstRowDots;
int numSpaces =( 36 - (numDots + 4))/2;
System.out.print(sideLines);
for (int i = 0; i < numSpaces; i++) {
System.out.print(space);
}
System.out.print(frontDashes);
for (int i = 0; i < numDots; i++) {
System.out.print(dot);
}
System.out.print(lastDashes);
for (int i = 0; i < numSpaces; i++) {
System.out.print(space);
}
System.out.print(sideLines);
System.out.println("");
}
// loop for shrinking triangle
for(int row = 0; row < 8; row++)
{
int firstRowDots = 28;
int numDots = -4*row + firstRowDots ;
int numSpaces =( 36 - (numDots + 4))/2;
System.out.print(sideLines);
for (int i = 0; i < numSpaces; i++) {
System.out.print(space);
}
System.out.print(lastDashes);
for (int i = 0; i < numDots; i++) {
System.out.print(dot);
}
System.out.print(frontDashes);
for (int i = 0; i < numSpaces; i++) {
System.out.print(space);
}
System.out.print(sideLines);
System.out.println("");
}
//Print bottom line
for(int j = 0; j < 36; j++)
{
System.out.print("_");
}
}
}