Answers.Body: <p>If possible, it is better to send the whole game. The engine can use this to see that a move it is considering would lead to a draw by threefold repetition or the 50 move rule.</p>
  <p>But sometimes you only have a position, and then sending a FEN is possible.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-28T16:13:07.357Z
Answers.Text: FEN includes a halfmove clock (though you still need the full list for threefold repetition)
Answers.UserDisplayName: Maciej Stachowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-05T00:24:54.663Z
Answers.Text: FEN does not have any way to notate available en-passant captures. The OP should send the list of moves as RemcoGerlich suggested.
Answers.UserDisplayName: causaSui
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-05T07:33:02.040Z
Answers.Text: @causaSui: actually it does, the fourth field is the "en passant target square", or "-" if there is no en passant possible.
Answers.UserDisplayName: RemcoGerlich
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-28T16:11:43.573Z
Answers.LastActivityDate: 2020-10-28T16:11:43.573Z
Answers.UserDisplayName: RemcoGerlich
Answers.Body: <p>It is preferable to pass a PGN because FEN is just a position with no move,  but a PGN is the whole game with moves.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-28T16:05:03.610Z
Answers.Text: But why is that preferable?
Answers.UserDisplayName: RemcoGerlich
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-28T16:07:46.480Z
Answers.Text: @RemcoGerlich in theory an engine might be able to use the move history to aid reasoning - eg. if you've played aggressively so far, the engine might use a different strategy than if you've played a defensive game. In practice, I have no idea if any engines actually reason beyond the board state.
Answers.UserDisplayName: Maciej Stachowski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-28T14:37:07.270Z
Answers.LastActivityDate: 2020-10-28T15:10:39.343Z
Answers.LastEditDate: 2020-10-28T15:10:39.343Z
Answers.UserDisplayName: Thomas Croon
Body: <p>I am actually programming a chess UI and I'd like to communicate with a chess engine using UCI protocol. After reading the protocol specifications, I am not sure how to use the position command. For each move, is it better to pass to the chess engine a FEN notation of the actual state of the board or pass it the list of all moves that have been played since the beginning of the game?</p>
  
Tags: <engines><programming><uci><fen>
Title: Is it preferable to pass a FEN notation or list of moves to a chess engine?
ThreadText: # Is it preferable to pass a FEN notation or list of moves to a chess engine?
  
  (Asked by: username_0 on 2020-10-28)
  
  I am actually programming a chess UI and I'd like to communicate with a chess engine using UCI protocol. After reading the protocol specifications, I am not sure how to use the position command. For each move, is it better to pass to the chess engine a FEN notation of the actual state of the board or pass it the list of all moves that have been played since the beginning of the game?
  
  **Tags:** engines, programming, uci, fen
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-10-28. Score: 1 | Accepted answer
  
  If possible, it is better to send the whole game. The engine can use this to see that a move it is considering would lead to a draw by threefold repetition or the 50 move rule.
  
  But sometimes you only have a position, and then sending a FEN is possible.
  
  > **Comments:**
  > **username_2**: FEN includes a halfmove clock (though you still need the full list for threefold repetition)  
  > **username_3**: FEN does not have any way to notate available en-passant captures. The OP should send the list of moves as username_1 suggested.  
  > **username_1**: @username_3: actually it does, the fourth field is the "en passant target square", or "-" if there is no en passant possible.  
  
  ---
  
  ### Answer by username_4 on 2020-10-28. Score: 2
  
  It is preferable to pass a PGN because FEN is just a position with no move, but a PGN is the whole game with moves.
  
  > **Comments:**
  > **username_1**: But why is that preferable?  
  > **username_2**: @username_1 in theory an engine might be able to use the move history to aid reasoning - eg. if you've played aggressively so far, the engine might use a different strategy than if you've played a defensive game. In practice, I have no idea if any engines actually reason beyond the board state.  
  
  ---
  
  