0

Trying to code a chess engine for the first time. I have connected my engine to the cutechess GUI cutechess. Currently my engine is receiving the current position from cutechess as something like: position startpos moves e2e4...etc

But looking at this from the UCI protocol:

enter image description here

I think my engine should have the option to receive the current position as a FEN string from cutechess GUI instead of position startpos moves e2e4...etc.

Debug Log:

  • ChessBot(0): uciok
  • ChessBot(0): isready
  • ChessBot(0): readyok
  • ChessBot(0): ucinewgame
  • ChessBot(0): position startpos
  • ChessBot(0): position startpos moves f2f3
  • ChessBot(0): isready
  • ChessBot(0): readyok
  • ChessBot(0): go wtime 300000 btime 300000 movestogo 40
  • ChessBot(0): bestmove e7e5

Instead of my engine receiving: position startpos moves f2f3

How do I instead receive position fen (fenstring)?

UCI protocol: UCI Protocol

Cam
  • 21
  • 3
  • You might want to look at other questions like https://chess.stackexchange.com/questions/8462/uci-engine-state-notion – Progman Aug 06 '23 at 01:05
  • Also check https://gist.github.com/DOBRO/2592c6dad754ba67e6dcaec8c90165bf#file-uci-protocol-specification-txt for the TXT representation of the specification, which actually shows the `` token for the `fen` option. – Progman Aug 06 '23 at 01:06
  • Instead of starting from the starting position, edit the board in the GUI to make it start from a custom position. – interjay Aug 06 '23 at 14:59
  • Actually you can basically do nothing. The engine should be able to receive ```position startpos```, ```position startpos moves [moves]```, ```position fen [fen]``` and ```position fen [fen] moves [moves]```. It's the GUI decision. But most GUI send ```position startpos moves [moves]```, as the list of moves can be useful for the engine to detect a repetition or to change its time management based on the number of moves. – LittleCoder Aug 25 '23 at 10:32
  • @LittleCoder Thanks. I did eventually figure it out, but this is what I was looking for. – Cam Aug 31 '23 at 18:43

0 Answers0