title: Recursive minesweeper "0-fill"
body: <p>I'm creating a java implementation of Java for fun and I'm trying to fill in all zeros when you click a pool of them.  (Play Minesweeper to see what I'm talking about)</p>
  
  <p>Here is my recursive call:</p>
  
  <pre><code>private void revealZeros(int x, int y) {
  
      if (board[y][x].revealed)
          return;
      board[y][x].revealed = true;
      if (y &gt; 0) {
          if (x &gt; 0)
              if (!board[y - 1][x - 1].revealed &amp;&amp; board[y - 1][x - 1].b == 0)
                  revealZeros(y - 1, x - 1);
          if (x &lt; 15) {
              if (!board[y - 1][x + 1].revealed &amp;&amp; board[y - 1][x + 1].b == 0)
                  revealZeros(y - 1, x + 1);
          }
          if (!board[y - 1][x].revealed &amp;&amp; board[y - 1][x].b == 0)
              revealZeros(y - 1, x);
      }
      if (x &gt; 0)
          if (!board[y][x - 1].revealed &amp;&amp; board[y][x - 1].b == 0)
              revealZeros(y, x - 1);
      if (x &lt; 15)
          if (!board[y][x + 1].revealed &amp;&amp; board[y][x + 1].b == 0)
              revealZeros(y, x + 1);
      if (y &lt; 15) {
          if (x &gt; 0)
              if (!board[y + 1][x - 1].revealed &amp;&amp; board[y + 1][x - 1].b == 0)
                  revealZeros(y + 1, x - 1);
          if (x &lt; 15)
              if (!board[y + 1][x + 1].revealed &amp;&amp; board[y + 1][x + 1].b == 0)
                  revealZeros(y + 1, x + 1);
          if (!board[y + 1][x].revealed &amp;&amp; board[y + 1][x].b == 0)
              revealZeros(y + 1, x);
      }
  
  }
  </code></pre>
  
  <p>The call is not working properly.  It reveals blocks other than 0 and does not reveal all 0 blocks.  </p>
  
  <p>Space.b = the number of bombs around it<br>
  Space.revealed = is the space revealed?</p>