public String toString() {
    StringBuffer buf = new StringBuffer();
    for (int yPos = 0; yPos <= maxIndex; yPos++) {
      for (int xPos = 0; xPos <= maxIndex; xPos++) {
        Tile tile = getTile(xPos, yPos);
        String tileStr = "(empty)";
        if (tile != null)
          tileStr = tile.getName();
        buf.append(tileStr);
        if (xPos < maxIndex) {
          // Pad with spaces to a length of 11
          for (int i = 0; i < 11 - tileStr.length(); i++)
              buf.append(' ');
        }
      }
      // End of row
      if (yPos < maxIndex)
        buf.append('\n');
    }
    return buf.toString();
  }