public static String getCoastlineCoding(Game game, Position center) {
    char[] coding = {'0','0','0','0' };

    int row = center.getRow(), col = center.getColumn();
    Position p; 

    int offsetRow[] = { -1,0,+1,0 };
    int offsetCol[] = { 0,+1,0,-1 };

    // iterate over the four compas directions
    //   for each find the proper tile p and
    //   check if there is a coastline
    for ( int i = 0; i < 4; i++ ) {
      p = new Position( row+offsetRow[i], col+offsetCol[i]);
      if ( p.getRow() >= 0 && p.getRow() < GameConstants.WORLDSIZE &&
           p.getColumn() >= 0 && p.getColumn() < GameConstants.WORLDSIZE &&
           game.getTileAt(p).getTypeString() != GameConstants.OCEANS ) {
        coding[i] = '1';
      }
    }
    String s = new String(coding);
    return s;
  }