code: function nextNeighbor(elt, dir) {
      var drow = 0, dcol = 0;
      if (dir == "none") {
        return null;
      } else {
        var offset = directions[dir];
        return {r: elt.r + offset[0], c: elt.c + offset[1]};
      }
    }
docs: Takes the current location and direction at this point and returns the next location to check. Returns null if this cell is not part of a shape.