package com.blogspot.na5cent.pyramid;

/**
 * @author redcrow
 */
public class Example2 {

    private static void walk(int max, int running, boolean deep) {
        if (deep) {
            walk(running, 1, false);
        } else {
            System.out.print(running + " ");
        }

        if (running == max) {
            if (!deep) {
                System.out.println("");
            }
            return;
        }

        walk(max, ++running, deep);
        if (deep) {
            walk(running - 1, 1, false);
        }
    }

    public static void main(String[] args) {
        walk(7, 1, true);
    }

}

@@ -221,20 +221,10 @@
    %7D
- else %7B%0A    
+%0A%0A
     
@@ -244,16 +244,28 @@
 t.print(
+deep ? %22%22 : 
 running 
@@ -272,27 +272,16 @@
 + %22 %22);%0A
-        %7D%0A%0A
         
@@ -318,74 +318,43 @@
     
-if (!deep) %7B%0A                System.out.println(%22%22);%0A            %7D
+System.out.print(deep ? %22%22 : %22%5Cn%22);
 %0A   
@@ -557,9 +557,9 @@
 alk(
-7
+5
 , 1,

add Example2