1

I checked the UCI specification here and I don't see a way to undo a move. I'm using stockfish, is there a way to do this?

For example, how would I accomplish the following:

position startpos moves e4c5
undo

With the intent of the above "undo" to result in a position of e4

4

Unfortunately the UCI protocol is stateless, there is no way to ask the engine to undo a move. The protocol is designed for communication between GUI and engine, you are supposed to have your own board representation such that you can update the engine.

For example, you would need to do:

position startpos moves e4c5
position startpos

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.