Snapshots

SokobanSnapshot

class SokobanSnapshot(moves_data: str = '')

Bases: Snapshot

Snapshot implementation for Tessellation.SOKOBAN and SokobanTessellation.

__init__(moves_data: str = '')

HexobanSnapshot

class HexobanSnapshot(moves_data: str = '')

Bases: Snapshot

Snapshot implementation for Tessellation.HEXOBAN and HexobanTessellation.

__init__(moves_data: str = '')

TriobanSnapshot

class TriobanSnapshot(moves_data: str = '')

Bases: Snapshot

Snapshot implementation for Tessellation.TRIOBAN and TriobanTessellation.

__init__(moves_data: str = '')

OctobanSnapshot

class OctobanSnapshot(moves_data: str = '')

Bases: Snapshot

Snapshot implementation for Tessellation.OCTOBAN and OctobanTessellation.

__init__(moves_data: str = '')

Snapshot

class Snapshot(tessellation: Tessellation, moves_data: str = '')

Base class for game snapshots and accompanying metadata.

Game snapshot is a sequence of pusher steps representing actual steps, jumps (in reverse solving mode) and pusher selections (in Multiban variant).

l: Final[str] = 'l'
u: Final[str] = 'u'
r: Final[str] = 'r'
d: Final[str] = 'd'
L: Final[str] = 'L'
U: Final[str] = 'U'
R: Final[str] = 'R'
D: Final[str] = 'D'
w: Final[str] = 'w'
W: Final[str] = 'W'
e: Final[str] = 'e'
E: Final[str] = 'E'
n: Final[str] = 'n'
N: Final[str] = 'N'
s: Final[str] = 's'
S: Final[str] = 'S'
JUMP_BEGIN: Final[str] = '['
JUMP_END: Final[str] = ']'
PUSHER_CHANGE_BEGIN: Final[str] = '{'
PUSHER_CHANGE_END: Final[str] = '}'
CURRENT_POSITION_CH: Final[str] = '*'
classmethod is_move_step(character: str) bool
classmethod is_push_step(character: str) bool
classmethod is_pusher_step(character: str) bool
classmethod is_marker(character: str) bool
classmethod is_snapshot(line: str) bool

True if line contains only:

  • movement characters

  • other snapshot characters (ie. jump markers)

  • Rle characters

  • spaces and newlines

to_str(rle_encode=False) str

Formatted output of parsed and validated moves data.

property tessellation: Tessellation
property moves_data: str
property pusher_steps: List[PusherStep]

Game engine representation of pusher steps.

Warning

Setting this property will also replace moves_data.

property pushes_count: int

Count of box pushing steps.

property moves_count: int

Count of steps that are not pushing a box and are not selecting pusher.

property jumps_count: int

Count of groups of steps that are jumps. Jumps are possible when board is being solved in reverse mode.

property is_reverse: bool

True if snapshot contains any jumps.