Hi everyone again,
because i felt not very happy about some conclusions, explanations
given in this thread, i decided to call a good friend. He is a strong
chess player,chess trainer and acted as well as arbiter.
It started with the first call,continued with 2nd and ended with a fourth call.
In sum i think we were phoning about an hour.
My intention is to give a summary, where someone can be sure to interpret the fide-rules correctly.
Most of you will have correct implementations , but who knows what the
following summary can be useful for. Maybe only a part is useful, maybe
the complete summary. (for chessplayer + chessprogrammers)
Code: Select all
================================================================================
1: Definitions Move:
================================================================================
the following movetypes are needed for the following explanations.
TYPE_1: executed move (Emove)
- a move is executed (but not completed) if it is physically done
on the board.
TYPE_2: completed move (Cmove)
- a move is completed, if it is executed(type1)
- the _own_ timer has been stopped.
TYPE_3: intention to move (Imove)
- a move which s.o. is allowed to make physically on the board.
- is neither type1 nor (in any case) type2
================================================================================
2: Handle BOARD/POSITION STATUS:
================================================================================
a: Equal position(Repetition)
--------------------
- castle rights are the same
- ep-status is the same
- color to move is the same
- pieces of the same types occupy the same squares.
b: rule50
--------------------
- counter = 0 if no _Cmove_ is done so far
if - pawn-move(_Cmove_) reset to 1
else if - capture-move (_Cmove_) reset to 1
else - increment counter on _Cmove_
================================================================================
3: Creating Draw Conditions:
================================================================================
a: 3-fold-repetition
- having an _Imove_ creating a position of 2a
occuring 2x before in the gamehistory.
(The corresponding _Cmove_ would lead to the physically
3-fold-repetition)
b: rule50
- having a counter set to 99, based on the rules 2b
- having an _Imove_ which corresponding _Cmove_ would set the counter to 100
(The corresponding _Cmove_ would lead to the physically
100 plies(50 moves) of both sides)
================================================================================
4: Claim on Draw:
================================================================================
- having an _Imove_ available of 3a or 3b _createDrawCondition_
- without any condition if the draw-condition is a _keptDrawCondition_.
4.1: if all conditions are given on the definitions so far the
arbiter has to agree the draw.
The game ends immediatelly, without converting the _Imove_ to _Cmove_.
(the move won t be executed in any form)
4.1.1: if the player who is creating the Draw-Condition claims draw,
the physically draw-position will never appear on the board.
================================================================================
5: Broken Situations
================================================================================
5.1: broken counter(ex: reset on castle)
- _Imove_ becomes _Cmove_ (no other moveChoice possible)
- draw offer (through the claim) is kept
opponent is able to draw immediatelly.
5.2: broken repetition (ex: broken ep-status)
- like 5.1
5.3: broken moves (ex: Nf6d4)
- another move _has to_ be done.
- draw offer (through the claim) is kept
opponent is able to draw immediatelly.
================================================================================
6: Programmer Issues:
================================================================================
6.1 MOVE
- all moves are _Imoves_ as long the moves dont
leave the engine through communiction.
6.2 Root-Position:
- Engine = Player
- Gui = Arbiter
- if at the root an _Imove_ is available which creates the
drawConditionsthe engine should mark the move in some way.
example:
bestmove e2a6
bestmove e2a6C (would be great, C for claim).
- The gui should immediatelly draw the position,and end the game.
The move shouldnt be executed.(Assuming no broken situations).
6.3 Iternal Search:
- moveDo() = player
- search() = arbiter
The iternal execution of a move can be seen as combination of
_Imove_+_Cmove_ type.The halfmoveclock is incremented on the
above given conditions.(lets say in the moveDo() function)
Having a position where halfmovelcok is 99, additionaly having
a move that creates the drawCondition,and executing it(moveDo()),
the score of the following position (search-call) is 0.
In this case _our_ arbiter is adviced on the condition hmc>=100 to
return the drawScore.
Same for 3-fold-repetion.We execute our move. _Our_ arbiter
is detecting the position for the 3rd time and returns the drawScore.
6.4 Difference to OTB:
- The point is, we can handle the rules internal in a "physical" way,
assuming the executed move is a claim on draw.
In this manner the search returns 0 when:
1. hmc >= 100 (rule50)
2. the current position is found 2x before in the gamehistory.
6.5 Hashing Equal positions:
- the hashkey for a position should include the listed
board information of 2a.
Some of the definitions given in this text are _combinations_ of fide-rules-articles.
In hope that my english is not to bad, producing some changes in its
content, i hope further the post will help to avoid,find any kind of bugs.
simple: hope it can help
best regards Michael