csokoban(6)

NAME
csokoban - sokoban for the Linux console

SYNOPSIS
csokoban [-hlqv] [-D DIR] [-S DIR] [NAME] [-LEVEL]

DESCRIPTION
This is an implementation of the classic game of sokoban, to be played on the Linux console.

The object of the game is to move all the boxes into the specially marked spaces. The boxes cannot be pulled, only pushed, and only one box can be moved at a time.

There are many levels, each with a unique configuration of walls, boxes, and goal spaces. The mechanics of the game are very simple, but finding solutions can sometimes be extremely challenging.

OPTIONS

-D DIR
    Look for game files in the directory DIR instead of the default.

-h  Display a brief summary of the command-line options and exit.

-l  List the available game files and exit.

-q  Play quietly; don't ring the bell during the game.

-S DIR
    Save your solutions in the directory DIR instead of the default.

-v  Display version information and exit.

-w  Display your solution with the least number of moves for the level specified on the command line (using NAME and/or LEVEL) as a series of text images, using the same representation as the game files (see FILE FORMATS below), and exit.

-W  Same as -w, but uses your solution with the least number of pushes.

NAME
    Play only the games in the file NAME. NAME can be either the name (or the prefix of a name) of a file in the game files directory (i.e., one of the files displayed with the -l option), or an explicit filename. In the latter case, the saving of solutions will be disabled.

-LEVEL
    Start playing at level LEVEL. (This number is the same as the index number displayed in the upper right corner while playing.) If this option is not used, csokoban begins at the first level you haven't solved yet.

KEY COMMANDS

hjkl
    The vi keys move you around in the traditional fashion (h=left, j=down, k=up, l=right).

HJKL
    Using shift repeats the move as many times as possible.

arrows
    The arrow keys can be used for movement as well.

x   Undo the previous move.

X   Undo the previous eight moves.

z   Redo the last move (presuming the last move was an undo).

Z   Redo the last eight undone moves.

m   Toggle macro recording on and off. (A capital M is displayed on the right while macro recording is on.) By recording a sequence of moves, the sequence can be automatically repeated any number of times. A macro is keyed to the location where recording is started. Different locations in the map can each have their own macro. (A capital P is displayed on the right whenever a macro is available at the current position.)

p   Play back the macro recorded at the current location. The macro will stop playing early if an attempted move is not possible.

s   Save the current position. There is no limit on the number of positions that can be saved. (A capital S is displayed on the right when one or more positions have been saved.)

r   Restore the last saved position. Undo and redo positions are also restored, but not macros.

S   Save the current position to disk. The position will be available via redo whenever you return to this level. Note that this option is only available for an unsolved level. The position will be remembered until a complete solution is found or until this command is used again.

R   Restart the game from the beginning. Any recorded macros are lost, but saved positions are retained.

Ctrl-R
    Also restarts the game, but with a different redo list (see below).

P   Go to the previous level, quitting the current one.

N   Go to the next level, quitting the current one.

q   Quit; exit the program.

Ctrl-L
    Redraw the screen.

SOLUTIONS
When a solution for a level is found, the game automatically stores it in your personal save directory. csokoban will remember up to two solutions per level: one using the least number of moves, and one using the least number of pushes.

When a game that you have already solved begins, the solution is loaded into the redo list. This permits you to view your solution and/or perhaps use it as the start of finding a better solution. By default, the solution that uses the least number of moves is used. However, if you have a different solution for the least number of pushes, you can explicitly load it by restarting the game with Ctrl-R.

FILE FORMATS
A game file contains a number of maps that comprise a complete series of levels. The level maps are separated from each other in the file by one or more blank lines, and/or lines beginning with a semicolon, single quote, or equal sign. The map is defined using the following characters:

#   wall

$   box

.   goal

*   box on a goal

+   player on a goal

If a line within the map contains a semicolon, it and the remaining characters on the line are ignored.

If a map is preceded by a line of text prefixed with two semicolons, the text of that line will be displayed along with that map. Similarly, each file can have a line of text prefixed with two semicolons to provide text to be displayed along with all the maps in that series.

The files containing your solutions are given the same name as the game files, and solutions appear in the same order. Solutions are separated from each other by blank lines, and/or lines beginning with a semicolon. The solutions are stored as a sequence of h j k l characters, representing moves left, down, up, and right respectively. A capital letter is used to indicate that the move includes pushing a box. Each solution is prefixed by a line indicating the number of moves and pushes it involves. If there are two solutions for a given level, the one for the minimum number of moves appears first.

The solution files are meant to be human-readable, but not human-editable. csokoban does minimal error-checking on the contents of the solution files. If you change a solution by hand, and do so incorrectly, it is possible that csokoban will discard the solution entirely the next time it writes to that file, as well as every solution following it.

DIRECTORIES

/usr/local/share/csokoban/
    The default directory searched for game files.

~/.csokoban
    The default directory for storing solutions.

ENVIRONMENT

SOKSAVEDIR
    Specifies an alternate directory for storing solutions.

LICENSE
csokoban is copyright (C) 2000 by Brian Raiter <breadbox@muppetlabs.com>.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file COPYING, included in the distribution, for more details.