Printing a large character from small characters
<p>I am trying to get a program to print a 'X' with x's. ie:</p>

<pre><code>xxx      xxx
 xxx    xxx
  xxx  xxx
   xxxxxx
  xxx  xxx
 xxx    xxx
xxx      xxx
</code></pre>

<p>This is what I have done so far:</p>

<pre><code>import java.util.Scanner;
public class CustomXfactor {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        boolean quit = false;
        int i=0, a=0, c=0;

        System.out.printf("length must be between 16 and 120\n");

        //Ask for desired length
        System.out.printf("Please enter the length (0  to exit):\n");
        int length = in.nextInt();
        int spaces = (length-length+1), //Calculate spaces before the first leg
                innerSpaces = (length-6); //Calculate the inner spaces -6
                                         //because there is 6 Xs which are 
                                         //the form the legs

        while(!quit){
            //Print first half of the X
            for (i=0;i&lt;(length/2);i++){

                //First XXX leg
                System.out.printf("XXX");

                //Space between the legs
                for (a=length-6;a&lt;innerSpaces;a++){
                    System.out.printf(" ");
                }
                //Second XXX leg
                System.out.printf("XXX\n");

                //SPACES 
                for (c=0;c&lt;(spaces);c++){
                System.out.printf(" ");
                }
                spaces++;
                innerSpaces--;
            }
            quit = true; //Change boolean to break while loop
        }//END of while loop
    }//END of method main
}//END end of class CustomXfactor
</code></pre>

<p>My math issue is in line 26. I am not getting the loop to print the correct spaces between the legs of the X, and then taking one away as it loops.</p>

<p>As you can see, this is only half of the X, but once I got this side, I can reverse it to generate the rest.</p>

<p>I would appreciate some help on my math there.</p>
