xlaby - X Labyrinth, the aMAZEment
xlaby [ options ]
X Labyrinth is a labyrinth game under X11 that is played directly with
the mouse pointer: the walls block the pointer’s movement on the
The goal of the game is to retrieve the four colored squares: to
retrieve a square, it is sufficient to move the pointer over it, and it
will disappear. However, to make things more infuriating, the squares
have to be taken in the following order: red, yellow, green and blue.
When the blue square is obtained, the game is won.
Unless otherwise specified (see OPTIONS below), it is possible to quit
the game at any moment by pressing Q or escape and to suspend the game
by pressing Z or tab (same key to resume).
If the maze window is suddenly obscured or changes size or position, it
is possible to restore it to the correct position, size and visibility
by pressing the space bar.
It is possible to chose between three types of maze building algorithms
(see OPTIONS below): the "tree", "flood" and "chain" maze.
Exit code is 1 in case of error, 42 if the maze was successfully
solved, and 0 otherwise. This can be useful in shell scripts for
example to test the user’s patience.
Run in blind mode. You don’t get to see the walls of the maze,
which makes it slightly harder.
Show the maze as it is being built. This is the best possible
explanation of how the maze building algorithms work.
Use the chain maze building algorithm: the maze is built by a
self-avoiding random walk that starts from start every time it
Display copying information and exit. See the file COPYING for
Run in semi-blind mode. The walls become visible only when you
bump into them.
Run on the specified display. Overrides the DISPLAY environment
Grab the keyboard as long as the game is being played. This
inhibits window manager hotkeys for example; frequently used in
conjunction with --noquit
Use the flood maze building algorithm: the maze is built by a
self-avoiding random walk that starts from the last possible
place every time it is blocked.
Print help information and exit.
Print game instructions and exit.
Do not play the game (only display the generated maze).
Forbid quitting the game (i.e. disables the Q and Z keys).
Beware, this can be dangerous, especially when used in
conjunction with --grabkbd.
Play the game. This option is compulsory (so that people won’t
accidentally start xlaby and then not know how to quit).
--pos X Y
Define the X and Y position of the maze window. If this
parameter is omitted (or invalid values are given), window
position will be chosen at random.
Run in quantum mode: every time the pointer changes cell, it has
a certain probability of doing a quantum leap to another
position in the maze. It is uncertain whether that actually
makes things easier or more difficult.
-s, --size number
Set the maze size. number is a number between 0 (very small)
and 9 (huge). Note that the maze will always fit in the screen:
if it is too large, the cell size will be reduced, and if that
is still not sufficient, the maze dimensions will also be
reduced. Note that xlaby will not run if the dimension of the
root window is less than 40x40 or so :-(
Use the tree maze generating algorithm: the maze is built by
growing trees of walls from the edges and the center. It is very
easy to solve, and also quite slow for large sizes.
Print version number and exit.
Print absence of warranty and exit. See the file COPYING for
Note that multiple options cannot be concatenated, so
is not valid: use
xlaby -p -t
Also note that standard X toolkit options are not recognized, as the
program uses low-level X.
The default display name.
Option syntax is very non-standard. Having to use the --play option is
X resources are not recognized. The colors cannot be specified. Only
the position of the window can be given, and it does not interact
properly with the window manager (only I do not trust WMs).
There are probably cases which I overlooked and in which the window is
not fully visible. Unfortunately, as far as I know, the Xlib does not
furnish any easy way of making absolutely sure a window is entirely
I guess it must look awful on a monochrome display.
The tree maze is outrageously slow for large maze sizes.
The game is about unplayable when run across a network as the mouse
cursor may freeze for a long time on a cell boundary.
There is no high score table. So the name of the first person who
completes the size 9 chain maze in blind mode shall not go down in
History (still, if you do, send me a mail).
The blue square (randomly placed) may overlap another one. Actually,
this is more a feature than a bug.
There is no way to change the number, colors, or position of the
The man page does not describe all the bugs (otherwise this section
would be the longest by far).
Peter Horvai (email@example.com) for the initial idea and chain maze
David Madore (firstname.lastname@example.org) for most of the programming, the
tree maze algorithm, and this man page.
Special thanks to Mladen Dimitrov for the flood maze algorithm.
GNU public license. See the file COPYING for more information.
01 DEC 1997