different for loops java
<p>I'm having some difficulties with the following problem:</p>

<p>I'm making a little game where you're at a specific spot and each spot has each some possible directions.</p>

<p>The available directions are N(ord),E(ast),S,W . I use the function <code>getPosDirections</code> to get the possible directions of that spot. The function returns the directions into an <code>ArrayList&lt;String&gt;</code> e.g. for spot <code>J3: [E,W]</code></p>

<p>Now the game goes like this: 2 dice will be rolled so you get a number between 2 and 12, this number represents the number of steps you can make.</p>

<p>What I want is an <code>ArrayList</code> of all the possible routes</p>

<p>clarification of all the possible routes: 
When I'm at the current position I check what the possibilities are from there. Let's say that's go East and go West. So we get 2 new positions and from there on we need to check for the next possibilities again for both positions (until we took x directions) </p>

<p>(x equals the number thrown by the dice).</p>

<p>e.g.: I throw 3 and I'm currently at spot J3: </p>

<pre>[[E,N,E],[E,N,S],[E,S,E],[E,S,S],[W,N,E],[W,N,S],[W,S,E],[W,S,S]]</pre>

<p>How would obtain the last mentioned Array(list)?</p>
