title: Correct usage of Recursion
body: <p>I am just wondering if my usage of recursion is correct. The code works for the intended purpose; however, I am not sure if it is actually doing recursion. I have tried tracing through my program, but I don't understand why my output is correct. Basically, the program takes in a data file of spaces and blobs of '*' and my program is supposed to recursively calculate the number of blobs given a certain row and column in the array of spaces and blobs. The problem is that I am not sure why exactly when I used variables like north, south, east, west, it would be able to successfully return the values to me, as it seems that during recursion, each variable just exists within that call. Also, I am not sure why exactly north = count(row,col+1) would give a value for north, since everytime I iterate through the recursion of count, it doesn't seem to stop at a definite value for north, as in like it doesn't seem to stop and say to return 1 as north.</p>
  
  <pre><code> public static int count(int row, int col) {
    int north = 0, south = 0, east = 0, west = 0;
    if (map[row][col] == BLOB) {
       map[row][col] = MARKED;
       if (map[row][col+1] == BLOB) {
          north = count(row,col+1);
       }
       //Go South
       if (map[row][col-1] == BLOB) {
          south = count(row, col-1);
       }
       //Go East
       if (map[row+1][col] == BLOB) {
          east = count(row+1, col);
       }
       //Go West
       if (map[row-1][col] == BLOB) {
          west = count(row-1, col);
       }
       return (1 + north + south + east + west);
    }
    return 0;
  </code></pre>