SanUtils

object SanUtils

Utility object for converting between SAN (Standard Algebraic Notation) and Move objects. Provides methods to parse SAN strings into moves and to generate SAN strings from moves.

Overview

  • Parsing: Converts SAN strings into Move objects.

  • Rendering: Converts Move objects into SAN strings.

  • Utility: Provides helper methods for SAN-related operations.

Parsing Methods

  • sanToMove: Parses a SAN string into a Move object.

Rendering Methods

  • moveToSan: Converts a Move object into its SAN string representation.

Utility Methods

  • pieceTypeFromSanChar: Maps SAN characters to PieceType.

  • pieceToChar: Maps PieceType to SAN characters.

Example Usage

val move = SanUtils.sanToMove("e4", board, gameState)
val san = SanUtils.moveToSan(move, board, gameState)

Functions

Link copied to clipboard
fun moveToSan(move: Move, board: Board, gameState: GameState): String

Converts a Move object to its SAN (Standard Algebraic Notation) string representation.

Link copied to clipboard
fun sanToMove(san: String, board: Board, gameState: GameState): Move

Converts a SAN (Standard Algebraic Notation) string to a Move object for the given board and gameState.