package de.sebhn.algorithm.excersise4;

/**
 * Created by philo on 26.10.2016.
 */
public class PathNodes {

    public static void main(String[] args) {

    }

}

@@ -37,46 +37,75 @@
 4;%0A%0A
-/**%0A * Created by philo on 26.10.2016.
+import java.math.BigInteger;%0A%0A/**%0A * Prints all path to a certain n
 %0A */
@@ -131,18 +131,16 @@
 odes %7B%0A%0A
-  
   public
@@ -174,18 +174,831 @@
 args) %7B%0A
-%0A
   
+  int n = 2;%0A    BigInteger numberOfPaths = b(n, n, 0, %22%22);%0A    System.out.println(numberOfPaths);%0A  %7D%0A%0A  private static BigInteger b(int x, int y, int t, String s) %7B%0A    if (x %3C 0 %7C%7C y %3C 0) %7B%0A      return BigInteger.ZERO;%0A    %7D else if (x == 0 && y == 0) %7B%0A      System.out.println(%22 %22 + s + %22.%22); // print path%0A      return BigInteger.ONE;%0A    %7D%0A%0A    BigInteger r = BigInteger.ZERO;%0A%0A    if (y %3C x) %7B%0A      r = r.add(b(x - 1, y, 0, %22R%22 + s)); // right%0A    %7D%0A    if (y %3C= x) %7B%0A      r = r.add(b(x, y - 1, 0, %22U%22 + s)); // up%0A    %7D%0A    if (y %3E= x) %7B%0A      r = r.add(b(x - 1, y - 1, 0, %22F%22 + s)); // upRight%0A    %7D%0A    if (y %3E x + 1 && t != 2) %7B%0A      r = r.add(b(x + 1, y - 1, 1, %22L%22 + s)); // upLeft%0A    %7D%0A    if (y %3E= x && t != 1) %7B%0A      r = r.add(b(x - 1, y + 1, 2, %22D%22 + s)); // downRight%0A    %7D%0A%0A    return r;%0A
   %7D%0A%0A%7D%0A

add possible paths logic