uci

How to setup a custom board with a UCI chess engine (e.g. Stockfish)


I am making a chess GUI that uses stockfish as the chess engine. I want to allow the user to set up a custom board (i.e. they can place piece arbitrarily on the board). How do I set up the internal board in stockfish so that the engine can make moves in the custom board?

I found on the UCI documentation:

"* position [fen | startpos ] moves .... set up the position described in fenstring on the internal board and play the moves on the internal chess board." However, I can't seen to find what exactly the format of "fenstring" should be.


Solution

  • The "fenstring" is a special notation for chess positions called Forsyth–Edwards Notation or short FEN.