Here you can find the source of putCharAtLevel(PrintWriter out, int level, char c)
private static void putCharAtLevel(PrintWriter out, int level, char c)
//package com.java2s; // terms of the Lesser GNU General Public License (LGPL) import java.io.*; public class Main { private static int[] position; private static void putCharAtLevel(PrintWriter out, int level, char c) { int n = position[level] - 1; for (int i = 0; i < n; i++) { out.print(' '); }//from w w w. j a v a 2 s .co m out.print(c); } }