Game utilities¶
- class core.game.Bug(color: PlayerColor, bug_type: BugType, bug_id: int = 0)[source]¶
Bases:
object
Bug piece.
- COLORS: Final[dict[str, PlayerColor]] = {'b': PlayerColor.BLACK, 'w': PlayerColor.WHITE}¶
Color code map.
- REGEX: Final[str] = '(w|b)(Q|S|B|G|A|M|L|P)(1|2|3)?'¶
Regex to validate BugStrings.
- class core.game.Move(bug: Bug, origin: Position | None, destination: Position)[source]¶
Bases:
object
Move.
- PASS: Final[str] = 'pass'¶
Pass move.
- REGEX = '((w|b)(Q|S|B|G|A|M|L|P)(1|2|3)?)( ?(\\\\|\\-|\\/)?((w|b)(Q|S|B|G|A|M|L|P)(1|2|3)?)(\\-|\\/|\\\\)?)?'¶
MoveString regex.