function fillOcean(g, width, height) {
  var count = 0;
  var process_next = searchSurroundingSpace(g, 1, 1, width, height);
  do {
    var open = process_next;
    process_next = [];
    while (open.length != 0) {
      var nextSpace = open.pop();
      if  (g[nextSpace[0]][nextSpace[1]] == "")
      {
        g[nextSpace[0]][nextSpace[1]] = "ocean";
        process_next = process_next.concat(searchSurroundingSpace(g, nextSpace[0], nextSpace[1], width, height));
      }
      count = count + 1;
    }
  } while(process_next.length != 0);
}
//begin function group for Fill Ocean
begin function group for Fill Ocean
begin function group for Fill Ocean
function fillOcean(g, width, height) {
  var count = 0;
  var process_next = searchSurroundingSpace(g, 1, 1, width, height);
  do {
    var open = process_next;
    process_next = [];
    while (open.length != 0) {
      var nextSpace = open.pop();
      if  (g[nextSpace[0]][nextSpace[1]] == "")
      {
        g[nextSpace[0]][nextSpace[1]] = "ocean";
        process_next = process_next.concat(searchSurroundingSpace(g, nextSpace[0], nextSpace[1], width, height));
      }
      count = count + 1;
    }
  } while(process_next.length != 0);
}
function fillOcean ( g , width , height ) { var count = 0 ; var process_next = searchSurroundingSpace ( g , 1 , 1 , width , height ) ; do { var open = process_next ; process_next = [ ] ; while ( open . length != 0 ) { var nextSpace = open . pop ( ) ; if ( g [ nextSpace [ 0 ] ] [ nextSpace [ 1 ] ] == "" ) { g [ nextSpace [ 0 ] ] [ nextSpace [ 1 ] ] = "ocean" ; process_next = process_next . concat ( searchSurroundingSpace ( g , nextSpace [ 0 ] , nextSpace [ 1 ] , width , height ) ) ; } count = count + 1 ; } } while ( process_next . length != 0 ) ; }
begin function group for Fill Ocean
begin function group for Fill Ocean