summaryrefslogtreecommitdiff
path: root/README
blob: 14a47d70c62a9d1e32e73719a81be642d523ad84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
BUILDING
--------
To build just run 'make'. 


DESCRIPTION
-----------

dbox is a simple brute-force Sokoban level solver.  Usage is:

dbox [-v|-i|-p|-P] file [file2 ...]

-v	- Be verbose.  Print depth of search tree as searching is done.
-i	- Interactive.  Show an interactive version of the map once solved.
-P\-p	- Play.  Allows you to play the level.

The file is a Sokoban level defined like this:


Level 1
  ###   
  #.#   
  # ####
###B B.#
#. B@###
####B#  
   #.#  
   ###  

The first line is the title of the level.

The subsequent lines must all be of the same width and define the level.  The
'#' character defines a wall.  The 'B' character defines a box.  The '.'
character defines a target square.  The 'X' character can be used to define a
box already on a target square.

If no interactive mode is used the level will be displayed along with the
route to solve it, e.g.

Solving Level 1

  ###   
  #.#   
  # ####
###B B.#
#. B@###
####B#  
   #.#  
   ###  

Route = 'DULLRUUDRR'


INTERACTIVE MODE KEYS
---------------------

In interactive mode the following keys can be used.

P		- Follow the solution path if one was found.
Backspace/B	- Step back one move on the solution path.
Cursor Keys	- Move.  Note that the move will be blocked if the state of the
		  map is already known or moving a block will make the level
		  insoluble.
Q		- Quit.

Cursors to move, P to follow path, Q to quit, Backspace/B to step back