GNOME Bugzilla – Bug 703841
Claim Draw should display a message when a draw cannot be claimed
Last modified: 2013-08-14 02:33:09 UTC
If I press the Claim Draw button but a draw cannot be claimed, nothing happens at all. This seems odd. Instead, gnome-chess should display a dialog stating that a draw cannot be claimed.
Yup. I didn't know that the option was even functional until a month ago. The surprising thing is that nobody has filed this bug before.
Created attachment 251309 [details] [review] Display a dialog if Claim Draw fails Previously there was no user feedback at all if Claim Draw was used at an incorrect time. Instead, present a dialog explaining the usage of Claim Draw. It also informs the user the number of repetitions of the current board state and presents the halfmove clock.
Created attachment 251310 [details] screenshot of new dialog This patch depends on a commit from earlier today. It's a bit verbose, but I don't think it would be terribly helpful to just say "No try again later." The halfmove clock (which counts up the moves since last capture or pawn advancement) is unfortunately completely broken, so try to ignore that.
Halfmove clock is fixed in git.
Created attachment 251313 [details] Alternative dialog Alternative dialog, I like this one a bit better
Looks good to me. "Fifty moves have passed without capture" should probably be "50 moves have passed without a capture": - Writing 50 using numerals is more consistent with the text above ("3 moves have passed"), and it's usually better to write large numbers using numerals anyway. - "capture" needs an article.
Created attachment 251348 [details] [review] Display a dialog if Claim Draw fails Previously there was no user feedback at all if Claim Draw was used at an incorrect time. Instead, present a dialog explaining the usage of Claim Draw. It also informs the user the number of repetitions of the current board state and presents the halfmove clock.
Created attachment 251349 [details] [review] Display a dialog if Claim Draw fails Previously there was no user feedback at all if Claim Draw was used at an incorrect time. Instead, present a dialog explaining the usage of Claim Draw. It also informs the user the number of repetitions of the current board state and presents the halfmove clock.
Created attachment 251350 [details] Screenshot of newest version of the dialog Made your corrections; also I completely reworded the first point, since "The current board state has only occurred once before" is not a very clear way to say "two."
The dialog looks good now, but it seems there's a bug in the code which checks for repeated board positions. To see the problem: 1. Start a player-versus-player game. 2. Make these moves: 1. e4 e5; 2. Ke2 Ke7; 3. Ke1 Ke8. 3. Press Claim Draw. You'll see a dialog stating "It is the first time this board position has occurred." But actually this position has occurred once before, namely after 1. e4 e5.
After turn 1 the Kings are still able to castle, but after turn 3 they cannot. This is sufficient to make the positions different for purposes of determining triple repetition. A pawn's ability to capture en passant on the current move is also significant for the purposes of triple repetition. But it's certainly really confusing. I'm not sure the best way to present this on the dialog. Maybe add a new bullet point when this occurs, and say something along the lines of "the position has occurred X times before, but you weren't able to castle/ep then so it's really different."
Aha - you're right! This will rarely matter but when it does this is confusing. So yes, I think it would be a good idea to add an additional bullet point when two past positions differ only in castling/en passant states. The bullet point could simply mention that the castling/en passant state must be the same every time - I think that would be clear enough. By the way, apparently Karpov once claimed a draw incorrectly since the right to castle was not the same in each repeated position: http://en.wikipedia.org/wiki/Threefold_repetition#Karpov_versus_Miles
For 3.8.4 we can't add a dialog, but we can make the behavior a bit less confusing by simply preventing the user from claiming a draw unless it would be successful; pushed 694d454a to gnome-3-8
Created attachment 251519 [details] Screenshot This is the best I could come up with...
Created attachment 251521 [details] [review] Display a dialog if Claim Draw fails Previously there was no user feedback at all if Claim Draw was used at an incorrect time. Instead, present a dialog explaining the usage of Claim Draw. It also informs the user the number of repetitions of the current board state and presents the halfmove clock. https://bugzilla.gnome.org/show_bug.cgi?id=703841 https://bugzilla.gnome.org/show_bug.cgi?id=251519
Created attachment 251522 [details] [review] Display a dialog if Claim Draw fails Previously there was no user feedback at all if Claim Draw was used at an incorrect time. Instead, present a dialog explaining the usage of Claim Draw. It also informs the user the number of repetitions of the current board state and presents the halfmove clock.
Adam, do you know if the primary text "You cannot currently claim a draw." is supposed to end with punctuation? I can't seem to find this in the HIG (I know it's probably in there somewhere).
This dialog is what the human interface guidelines call an alert. The 3.8 guidelines seem to be ambiguous on this point: they contain one sample alert whose text ends with a period ("All updates are complete.") and another with none ("Cannot add user"). For what it's worth, I like the period in "You cannot currently claim a draw."
There seems to be one more bug. Note that whether a position is repeated should also be determined by whose move it is. To see the problem, start a human-versus-human game and play these moves: 1. d4 d5; 2. Qd3 Qd6; 3. Qd2 Qd8; 4. Qd1 Qd6; 5. Qd3 Qd7; 6. Qd1 Qd8; 7. Qd3 Qd6; 8. Qd2 Qd8; 9. Qd1. Now, as Black, press Claim Draw. The claim will succeed, even though this position has occurred only once before with Black to move, namely after 4. Qd1.
(In reply to comment #18) > > For what it's worth, I like the period in "You cannot currently claim a draw." Works for me! (In reply to comment #19) > There seems to be one more bug. Note that whether a position is repeated > should also be determined by whose move it is. To see the problem, start a > human-versus-human game and play these moves: > > 1. d4 d5; 2. Qd3 Qd6; 3. Qd2 Qd8; 4. Qd1 Qd6; 5. Qd3 Qd7; 6. Qd1 Qd8; 7. Qd3 > Qd6; 8. Qd2 Qd8; 9. Qd1. > > Now, as Black, press Claim Draw. The claim will succeed, even though this > position has occurred only once before with Black to move, namely after 4. Qd1. Good catch! I've filed Bug #705956
Attachment 251522 [details] pushed as 3c9ab4e - Display a dialog if Claim Draw fails