Sokoban Visualizer Help

Puzzle File Format

# Wall
  Space
. Goal
@ Sokoban
$ Box
+ Sokoban on Goal
* Box on Goal
% Comment Line

The classic sokoban rules are generalized to allow multiple sokaban. Squares containing sokoban may be proceded by an integer sokoban number. If multiple sokoban appear but are unnumbered, then they are assumed to be numbered in the order they appear. The range of numbered sokoban must not have gaps. Boxes may be likewise preceded by an integer box number and are otherwise numbered in the order in which they appear.

The visualizer also accepts an alternative puzzle format where the file begins with the number of rows, a comma, the number of columns, a comma, and then a series of strings each surrounded by double quotes and separated by white space that represent the rows.

Solution File Format

l Move Left
r Move Right
u Move Up
d Move Down
L Push Left
R Push Right
U Push Up
D Push Down
b N DIRECTION push box number N where DIRECTION is one of L,R,U,D
m r1, c1, r2, c2, move box at [r1,c1] to [r2,c2]
M C1, C2, move box at cell C1 to cell C2
% Comment line

Line breaks, tabs, and spaces in solution are ignored.

Locations are specifed by row and column for the m command and by cell number for the M command. Row, column, and cell numbers start at 0. Cells are numbered from location [0,0] right to left and top to bottom, so that

row = floor(cell / number columns)
column = cell mod number columns
Note the final comma that appears after the last argument to m or M.

Steps may be proceeded by an integer identifying the sokoban. If no integer appears sokoban 1 is selected.

The b commands first sends the sokoban on the shortest path to the appropriate side of the box and then pushes it in the specified direction. The m and M commands send the sokoban on the shortest path to the appropriate side of the box that is in the indicated location and then pushes the box to the new location.

An alternative solution file format is also accepted. If the file contains only integers and whitespace and no other characters, it is converted when read into a series of M commands.

Files

Puzzle Load puzzle file from local computer.
Solution Load solution file from local computer.
Example Load an example puzzle and solution as specified by the pop-up menu from the web server.
Reset Reset puzzle to its start state. The text in the solution box is not changed.
Clear Clear the solution and reset puzzle to its start state

Manual Entry of Solution

Record Clear solution from current position to end and start recording solution.
Stop Stop recording solution.
Allow multi-box pushes If checked, relax the rules to allow sokoban to push a series of boxes that end in a blank square.
Saving the recorded solution Select solution text and copy-paste to another application.
Arrow keys Move or push in corresponding direction.

Playback

Step Single step mode: advance when spacebar or Forwards is hit.
Auto Slow Slow autoplay until end or mode changed to Step.
Auto Medium Medium speed solution until end or mode changed to Step.
Auto Fast Fast autoplay until end or mode changed to Step.
Forwards or Spacebar Move forwards one step in solution.

Source Code

Clone from https://gitlab.com/HenryKautz/sokobanvisualizer.

Adding new example puzzles and solutions: