Fen Utils
object FenUtils
Utility object for parsing and generating FEN (Forsyth-Edwards Notation) strings. Provides methods to convert between FEN strings and board/game state objects.
Overview
Parsing: Converts FEN strings into Board and GameState objects.
Rendering: Converts Board and GameState objects into FEN strings.
Utility: Provides helper methods for FEN-related operations.
Parsing Methods
Rendering Methods
getFenFromBoardAndState: Generates a FEN string from a Board and GameState.
renderPiecePlacement: Converts the board's piece placement into FEN format.
renderCastlingRights: Converts castling availability into FEN format.
Utility Methods
pieceTypeFromFenChar: Maps FEN characters to PieceType.
Example Usage
val (board, gameState) = FenUtils.parseFen(FenUtils.DEFAULT_FEN)
val fen = FenUtils.getFenFromBoardAndState(board, gameState)Content copied to clipboard