getFenRepresentation method

String getFenRepresentation()

Returns FEN representation of current _position on the board.

Implementation

String getFenRepresentation() {
  String s = '';
  for (int row = 0; row < size; row++) {
    for (int col = 0; col < size; col++) {
      s += at(row, col)?.fenSymbol ?? '*';
    }
    if (row != size - 1) {
      s += '/';
    }
  }
  return s;
}