Identifying a draw in chess
Läst av 166 användare
We need to implement a rule that would detect a draw if the position on the board has not changed for a certain period of time. Here I would like to ask chess players for help - when should a draw be detected in chess (besides a stalemate)? I propose the following method: If there are fewer than 5 pieces on the board and the number of pieces on the board has not changed for 30 moves, a draw is detected. What do you think?
According to the rules, a draw is, for example, when both players make the same move 3 times. That is, 3 times back and forth. Such a situation is actually entirely possible, since one player may only have 1 move to save his position and the other forces him to make it until his opponent loses. Such a situation can also occur when there are still half the pieces on the board.
But a draw could also occur in the following situations: - instantly, when there are 2 kings left on the board. - instantly, when there are 2 kings and one knight/spear left on the board (to my knowledge, it is not possible to checkmate like this, but the wiser ones should comment on this point!).
But makeup, I think your idea is a good one
A chess game ends in a draw in the following cases: 1. If the opponents agree to this 2. If there is a sin 3. If the same position is on the board for the third time. (It must also be taken into account whose move it is) 4. If no piece has been captured or pawn has been moved within 50 moves. In addition, the program should detect a draw if there is insufficient material left on the board for checkmate: 1. bare king 2. king and knight 3. king and spear 4. king and two knights (in theory, checkmate is possible, but forcing it is impossible in 99.99% of cases) A draw should also be considered a situation where one of the players exceeds the thinking time, but his opponent no longer has enough material for checkmate at that moment. (For example, if one player has a king and a pawn and the other player only has a king, but the player with the pawn runs out of time before he has checked his opponent, the result is a draw. But if one player has a king and a pawn and the other player has a king and a pawn, the player who runs out of time loses.)
These are very interesting proposals. I would analyze these points a little separately: 1) From the point of view of implementation, the most difficult thing is to detect the same position for the third time. At this point, I would ask: Does the position of the entire board have to be identical, i.e. no pieces have been captured in the meantime? *The position of the board must therefore be remembered and checked until a piece is captured. Then the number of positions on the board must be cleared and a new round must be started. Do castlings/pawn exchanges have no effect here? I.e. after castling, can a pre-castling position still occur on the board? The same thing probably applies to pawn exchanges. 2) Understandable. You have to count the moves and if a piece is captured or a pawn is moved, the counter must be reset to zero. When the counter reaches 50, a draw is detected. 3) The same as what Tiit mentioned - A draw is detected when there are two kings and a lance/knight left on the board. We then give the player the opportunity to checkmate with two knights :) 4) If player A runs out of time (we're still only talking about the game-based / chess clock time system here?!?) and if at that moment user B has one king / one king and a rook / one king and a knight, is a draw recognized? Did I understand correctly? I'll try to implement the changes in the coming weeks.
after castling, can a pre-castling position still occur on the board? The same thing probably happens when exchanging a pawn.
No, it cannot. The ability to castle is one of the position parameters. You cannot castle twice in one game. When exchanging pawns, a pawn leaves the board and can never be returned. Consequently, the position cannot be repeated. In general: The position of the entire board must be exactly identical. This means: 1. All pieces must be still 2. All pieces must be in the same places 3. The castling option(s) must be the same 4. The mover must be the same This means that the set of positions can be cleared in the following cases: - when a piece is captured - when a pawn move occurs (because a pawn can never again end up on the square it left) In addition to the following cases: - when the first king move occurs (including castling) - when the first rook move occurs (including castling) - when the first move occurs with the second rook, if the king has not yet moved or castled (I guess that's how it should be :) This is a pretty good logic problem.) If a move occurs that creates an opportunity to capture [i]en passant[/i], then the set of positions is cleared, (because it was a pawn move), but the resulting position itself must not be saved yet, (because this position can never be repeated, because the [i]passant[/i] opportunity can only be used in the next in progress.)
But is it even necessary to empty the positions in certain cases? Maybe it would be easier to consider the castling option and [i]en passant[/i]i as one parameter that determines the position. Well, roughly, each position consists of information about sixty-four squares information about who has the move castling options [i]en passant[/i] options. But I don't know anything about programming and maybe I'm really missing something :)
2) Understandable. You have to count the moves and if you capture a piece or move a pawn, you have to reset the counter to zero. When the counter reaches 50, a draw is detected.
I noticed that the system currently counts every single move as a move. In fact, one move in chess is one white move one black move. So a draw is when both have moved 50 times.
This 3-fold addition can be a bit complicated. But there was one formal error here: all the pieces do not have to be on the same squares, i.e. e.g. two rooks of the same color can swap places, as can e.g. knights. a) The move must have the same player, b) NB! All possible moves must be the same (e.g. the right to castling, if it was there before, must still be there; passing capture also), c) Pieces of the same type must be on the same squares (as mentioned, rooks can swap places). But this should not cause any problems in programming. So capturing [because the same piece can only be obtained by pawn conversion, but then the number of pawns is not the same], pawn move, castling should reset the counter. The 50-move rule then applies to one side, i.e. white or black need to make 50 moves [quite a lot]. It shouldn't be limited to 30, because e.g. rook spear against rook is a well-known position that comes up from time to time and takes a lot of time to realize. At the same time, some fool might start to maliciously stretch the pawn against the pawn... The 50-move rule is reset by a pawn move or some kind of capture. By the way, shouldn't the system look for it automatically? Maybe we could add a button where the user can check whether it was or wasn't? But in that case, it should be limited somehow so that the user doesn't click it too much. [But this is such a random thought, I don't know if it would be reasonable. In real life, you have to determine it yourself, the position is not automatically considered a draw.] Notes: K-king, R-knight, O-spear, L-flag, V-rook 2R versus K is not a draw, the argument that it is not checkmated in real life is absurd. Then many positions could be evaluated that way. Certain draws are: a) only kings on the board [hereinafter I will only mention what may be in addition] b) O or R c) O of the same color versus O of the same color Now some positions that concern timeout for the stronger side [i.e. the positions are not draws, but the weaker side cannot win]: a) R versus L cannot win, b) O versus L cannot win, c) O versus V cannot win I am afraid that it is not possible to program a "dead position" in general, where, for example, pawns are blocked and kings cannot get through and there are no other pieces [then you probably have to rely on the 50 move rule v 3-fold repetition v the opponent's reasonableness that the draw will still be accepted], here is added, for example, a spear stuck behind your own pawns, etc. FIDE adjudicator and chairman of the EML adjudicator board