Finding all possible paths
<p>I have a problem to find all possible paths. </p>

<blockquote>
  <p>a a a b </p>
  
  <p>b a a a</p>
  
  <p>a b b a</p>
</blockquote>

<p>Traveling from starting point at 0,0 to end point at 2,3. 
I need to get all possible paths. </p>

<p>Possible moves that I can do are <strong>moving down</strong> and <strong>moving right</strong>.</p>

<p>Let me tell you where I am stuck. 
I am trying to do with a recursive function . Starting with point at 0,0 and moving towards right whenever I can and moving down only when I must. </p>

<p>My recursive function :</p>

<pre><code>public static move(int i,int j)
{
     if(possible(x,y+1))
    {
       move(x,y+1);
       move(x+1,y);
    }

}


public static bool possible(int i,int j)
        {
            if((i &gt;=0 &amp;&amp; i&lt;3 ) &amp;&amp; (j&gt;=0 &amp;&amp; j&lt;4))
                return true;
            else
                return false;

        }
</code></pre>

<p>Not sure about my recursive move function. Still need to expand it . I am not getting exactly how I should implement .</p>

<p>I am able to traverse upto the corner node using that move method but I need that function to retrace back whenever all possible moves from the corner top right point(0,4) is reached. </p>