Documentation
¶
Overview ¶
Package state implements Sokoban state structure and provides other helper functions.
Index ¶
Constants ¶
View Source
const ( BLANK = 0x0 BOX = 0x1 OBSTACLE = 0x2 PLAYER = 0x4 GOAL = 0x8 BOXONGOAL = GOAL | BOX PLAYERONGOAL = GOAL | PLAYER )
State tiles integer representations
View Source
const ( BLANKCHAR = "⬜" BOXCHAR = "🟩" OBSTACLECHAR = "🟥" PLAYERCHAR = "🐈" GOALCHAR = "⭕" BOXONGOALCHAR = "✅" PLAYERONGOALCHAR = "😿" )
State tiles human-readable representation (for both input and output)
View Source
const ( UP DOWN LEFT RIGHT )
Directions enum
View Source
const BORDER = 1
Added border for states (should never be less than 1)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
State is the main structure that stores the Sokoban board in Tiles, and the number of moves to get to this state in Moves.
func NewState ¶
NewState takes a the puzzle file path in puzzlePath, and the cost function in costFunc, and returns a state (mostly a start state).
Click to show internal directories.
Click to hide internal directories.