pub fn undo() -> Command
Expand description

Undo the last move.

Effects

The board configuration and the number of captured stones are reset to the state before the last move. The last move is removed from the move history.

Fails

  • Engine is unable to undo the last move ("cannot undo")

Comments

If you want to take back multiple moves, use this command multiple times. The engine may fail to undo if the move history is empty or if the engine only maintains a partial move history, which has been exhausted by previous undos. It is never possible to undo handicap placements. Use clear_board if you want to start over. An engine which never is able to undo should not include this command among its known commands.