soukoban
A library providing implementations of algorithms and data structures related to Sokoban.
Features
- Solver
- Level
- Zero-allocation lazy parsing: Parses levels lazily from an in-memory string without memory allocations except for level creation.
- Lazy stream parsing: Parses levels lazily from a stream.
- Map reconstruction: Reconstructs the map from the solution.
- Canonicalization: Removes elements from the map that are not relevant to the solution.
- RLE support: Enables loading of levels encoded in Run-Length Encoding (RLE) format.
- Symmetry transformations: Supports rotating and flipping levels.
- Actions
- Reversal move handling: Automatically interprets reversal moves as undo actions.
- Metrics calculation: Computes metrics such as
box_lines,box_changes,pushing_sessions, andplayer_lines. - Symmetry transformations: Supports rotating and flipping action sequences mapping.
- Pathfinding: Finds paths for box/player with support for different strategies.
- Deadlock detection: Detects static deadlocks and freeze deadlocks.
Example
use FromStr as _;
use ;
License
Licensed under either of
at your option.
The level files in the assets directory are licensed solely under
their respective licenses, available in the LICENSE file in the directory.