offer draw
If your engine wants to offer a draw by agreement (as opposed to claiming a draw by rule), it can send the command "offer draw". xboard relays the offer to the user, the ICS, the other engine in Two Machines mode, and the PGN save file as required. In Machine White, Machine Black, or Two Machines mode, the offer is considered valid until your engine has made two more moves. This command must also be used to accept a draw offer. Do not use the 1/2-1/2 command for that, as the offer might be no longer valid, in which case a refusal to play on implied by the RESULT command might make you forfeit the game. "offer draw" should also be used to claim 50-move and 3-fold-repetition draws that will occur after your move, by sending it before making the move. WinBoard will grant draw offers without the opponent having any say in it in situations where draws can be claimed. Only if the draw cannot be claimed, the offer will be passed to your opponent after you make your next move, just before WinBoard relays this move to the opponent.
I used to send a "1/2-1/2" after the move to claim a draw by repetition or 50 move draw. Recently I have changed to using "offer draw" before the move as recommended in the above quote. However, what I see in the debug log is as follows:
- Code: Select all
3455344 <second: # tb hit, score=+0.00
3455344 <second: 1 0 0 17 Ke2
3455344 <second: 2 0 0 33 Ke2
3455344 <second: 3 0 0 49 Ke2
3455344 <second: # terminating, tablebase hit
3455344 <second: # terminating search (controller)
3455344 <second: # search done : move = f2-e2
3455344 <second: 3 0 0 49 Ke2
3455344 <second: # state = 0
3455344 <second: # game_end = 0
3455344 <second: # in check_pending
3455344 <second: # 50 move draw
3455344 <second: offer draw
GameEnds(27, Draw agreed, 4)
Interrupting first
3455344 >first : result 1/2-1/2 {Draw agreed}
3455344 >second: result 1/2-1/2 {Draw agreed}
3455344 >first : force
3455344 >first : ping 30
3455344 >second: force
3455344 >second: ping 30
3455344 <second: move f2e2
Undoing extra move from second, gameMode 8
3455344 >second: undo
3455344 <first : pong 30
3455344 <second: # adding to pending list result 1/2-1/2 {Draw agreed}, list size=0
3455344 <second: # got cmd (main): # adding to pending list result 1/2-1/2 {Draw agreed}force
Note that 168. Rc1 was actually the 50th move w/o capture or pawn movement, but White didn't claim the draw. Black did, before making the move f2e2.
Winboard sends "Draw agreed" as the comment after the result string. I'd prefer it say "Draw by 50-move rule" to make it clear that the other engine didn't "agree," instead it is a draw by rule (for repetition it says {XBoard adjudication: repetition draw}).
Game follows. By the way this is Winboard 4.5.2 - possibly the behavior is different in later versions.
[Event "?"]
[Site "-"]
[Date "2012.11.27"]
[Round "?"]
[White "Ruffian 1.0.1"]
[Black "Arasan 15.1"]
[Result "1/2-1/2"]
[ECO "C47"]
[TimeControl "180+0"]
1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 Bb4 6. Nxc6 bxc6
7. Bd3 O-O 8. O-O d5 9. exd5 cxd5 10. Bg5 c6 11. Ne2 Re8 12. c3 Bd6
13. Qa4 Bd7 14. Qh4 h6 15. Bxf6 Qxf6 16. Qxf6 gxf6 17. Nd4 Rab8
18. b4 c5 19. bxc5 Bxc5 20. Rab1 h5 21. Rfd1 Rxb1 22. Rxb1 Bb6
23. Kf1 Rc8 24. Rb3 Ba4 25. Ra3 Bd7 26. Ke2 Kf8 27. Rb3 Ke7 28. g3
Rc5 29. Kd2 Ra5 30. Rb2 Ra3 31. Bc2 Kd6 32. Kd3 Ra5 33. Bd1 Bg4
34. Be2 Ra4 35. f3 Bd7 36. h4 Ba5 37. f4 Rc4 38. Rb3 Ra4 39. Bxh5
Rxa2 40. Bf3 Bb6 41. h5 Bc8 42. g4 Ba6+ 43. Ke3 Rh2 44. Rb1 Bc5
45. Rd1 Rc2 46. h6 Rxc3+ 47. Kf2 Rb3 48. Kg3 Bxd4 49. Rxd4 Bc4
50. g5 Kc5 51. Rd1 Rb8 52. Bh5 Rf8 53. Rb1 fxg5 54. fxg5 d4 55. Rc1
d3 56. h7 d2 57. Rc2 Rh8 58. Be2 d1=Q 59. Bxd1 Kb4 60. Rb2+ Kc3
61. Rb7 Rxh7 62. Rxa7 Be6 63. Bf3 Rh3+ 64. Kf4 Kd4 65. Ra4+ Kc3
66. Ra6 Rh4+ 67. Ke5 Rh3 68. Ke4 Rh8 69. Rd6 Rb8 70. Rd3+ Kc2
71. Ke3 Rb5 72. Be4 Kb2 73. Kf4 Rb6 74.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