Expand description
§soukoban
A library provides the implementation of algorithms and data structures related to Sokoban.
§Features
- 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.
- Normalization: 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.
- Solution
- Reversal move handling: Automatically interprets reversal moves as undo actions.
- Metrics calculation: Computes metrics such as
box_lines
,box_changes
,pushing_sessions
, andplayer_lines
.
- Pathfinding: Finds the optimal player path to push a box to a position.
- Deadlock detection: Detects static deadlocks and freeze deadlocks.
§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.
Re-exports§
pub use action::*;
pub use actions::*;
pub use error::*;
pub use level::*;
pub use map::*;
pub use tiles::*;
Modules§
- action
- An action.
- actions
- A sequence of actions.
- deadlock
- Utilities for deadlocks detection.
- direction
- A direction.
- error
- Error types.
- level
- A level.
- map
- A grid-based map.
- path_
finding - Utilities for path finding.
- run_
length - Utilities for run-length encoding encoding and decoding.
- solver
- A solver for the Sokoban problem.
- tiles
- Flags which can represent elements contained in map cells.