import java.awt.Color; import java.io.PrintStream; import java.util.Scanner; import franck.cse5910.Timing; import franck.cse5910.Grid; public class TreeOfBlocks { public static void main(String[] args) { PrintStream output = System.out; Scanner input = new Scanner(System.in); output.print("Enter the height of the tree: "); int height = input.nextInt(); Grid grid = new Grid(2 * h - 1, h + 1); final int SIZE = 20; grid.setSize(SIZE); final long DELAY = 10; for (int h = 0; h < height; h++) { for (int i = 0; i < 2 * h + 1; i++) { grid.set(height - 1 - h + i, h, Color.GREEN); Timing.pause(DELAY); } } final Color BROWN = new Color(150, 75, 0); grid.set(height - 1, height, BROWN); } }