/*
 * Diamond2.java
 *
 * This program uses for loops to draw a diamond. It defines
 * a class constant SCALE_FACTOR that allows the diamond to be
 * drawn at different sizes.
 *
 * Author: S-111 Course Staff
 * Date: June 26, 2015
 */

public class Diamond2 {
    public static final int SCALE_FACTOR = 1;

    public static void main(String[] args) {

        // draw the up-facing triangle
        for (int line = 1; line <= 2*SCALE_FACTOR + 3; line++) {
            // draw the spaces
            for (int i = 0; i < (2*SCALE_FACTOR + 3) - line; i++) {
                System.out.print(" ");
            }

            // draw the asterisks
            for (int i = 0; i < 2 * line - 1; i++) {
                System.out.print("*");
            }

            System.out.println();
        }

        // draw the down-facing triangle
        for (int line = 1; line <= 2*SCALE_FACTOR + 2; line++) {
            // draw the spaces
            for (int i = 0; i < line; i++) {
                System.out.print(" ");
            }

            // draw the asterisks
            for (int i = 0; i < (4*SCALE_FACTOR + 5) - 2*line; i++) {
                System.out.print("*");
            }

            System.out.println();
        }
    }
}
