Move object
- class draughts.move.Move(visited_squares: list[int], captured_list: list[int] = [], captured_entities: list[Figure.value] = [], is_promotion: bool = False)[source]
Move representation. End user should never interact with this class directly.
As we can read on wikipedia:
Multiple jumps, such as a double or triple jump, require you to pay attention, as the convention is to just show the start and end squares and not the in-between or intermediate squares. So the notation 1-3 would mean a King does a double jump from 1 to 10 to 3. The intermediate square is only shown if there are two ways to jump and it would not be clear otherwise.
Note that always: n - number of visited squares (include source square) n - 2 - number of captured pieces
- classmethod from_uci(move: str, legal_moves: Generator) Move [source]
Converts string representation of move to
Move
object. This is generic method, so it can be used for any board size. Therefore, For different context different move object will be generated. Also we need to pass legal moves, to understand given move and check if it is legal.input format:
<square_number>-<square_number>
for simple move<square_number>x<square_number>
for capture
Examples:
24-19
- means from 24 to 1924x19
- means from 24 to 16 means capture of piece between 24 and 161x10x19
- means capture of two pieces between 1 and 19