FEN (.fen)

As of Version 13.3, "FEN" has been superseded by the Wolfram/Chess paclet in the Wolfram Paclet Repository.
  • Import supports FEN notation.
  • Background & Context

      • Standard notation for describing positions of a chess game.
      • FEN is an acronym for ForsythEdwards Notation.
      • A single FEN string describes one state of the chess game.
      • A FEN file often stores a number of positions described with a FEN string.
      • ASCII format.
      • First developed by Scottish journalist David Forsyth; later extended by Steven J. Edwards.
      • FEN strings are used in PGN files to describe the initial position of a game.

    Import & Export

    • Import["file.fen"] imports a FEN file, returning graphics showing the positions.
    • Import["file.fen",elements] imports the specified elements.
    • See the following reference pages for full general information:
    • Importimport from a file
      CloudImportimport from a cloud object
      ImportStringimport from a string
      ImportByteArrayimport from a byte array

    Import Elements

    • General Import elements:
    • "Elements" list of elements and options available in this file
      "Summary"summary of the file
      "Rules"list of rules for all available elements
    • Game elements:
    • "ActivePlayer"player who moves next
      "FENStrings"FEN string for the move
      "MoveNumber"the move number of the game
      "PositionRendering"a Graphics rendering of the position
    • Import by default uses the "PositionRendering" element for the FEN format.
    • Move numbers should not necessarily correspond to the actual number of the move in the game. Typically, 0 means an unknown move number.
    • Overall file element:
    • "PositionCount"number of positions stored in the file

    Options

    • Elements that involve rendering a chessboard take the following options:
    • "BoardOrientation"Automaticon which side of the board to place white pieces
      "Icons"Automatica set of icons to use for chess pieces
      "SquareColors"Automatica list of two colors for light and dark squares