aboutsummaryrefslogtreecommitdiff

Maze

maze is a command line maze game.

Features

  • [x] Load/save maze from/to text file.
  • [x] Generate random maze.
  • [x] Solve maze.
  • [x] Help you solve maze by one move at once.
  • [x] Configurable key bindings in defaults.h.

Dependencies

  • ncurses

On ubuntu, you can install the dependencies by running the following command with root privilages:

# apt install libncurses-dev

Building and Installation

Currently, this program is not available in any package manager, so you have to build it from source. The build uses CMake, which works in two steps — configure, then build:

$ cmake -B build
$ cmake --build build

The first command inspects your system and generates the build files under build/; the second compiles the program. After the first configure, you only need to re-run cmake --build build to pick up source changes.

Once built, the executable is at build/maze, and you can run it without installing:

$ ./build/maze

To install it on your system, run a third command:

# cmake --install build

By default, maze is installed using the prefix "/usr/local", so the full path of the executable will be "/usr/local/bin/maze" and the man page will be installed under "/usr/local/share/man/man1". Installing there requires root privileges.

You can install maze into a directory of your choice by setting the prefix at configure time:

$ cmake -B build -DCMAKE_INSTALL_PREFIX="/your/dir"
$ cmake --build build
$ cmake --install build

On Termux this is handled for you: the prefix defaults to $PREFIX (Termux's own install root), so a plain cmake --install build installs to $PREFIX/bin with no root and no extra flags.

To remove the program from your system, delete the files recorded in the install manifest that CMake writes during installation (drop the leading #/root on Termux):

# xargs rm < build/install_manifest.txt

If you ever want a clean rebuild from scratch, remove the build directory and configure again:

$ rm -rf build

Usage

Please see the man page for more information.

You can see the man page by runing the following command in the project directiory:

$ man doc/maze.1

Or you can do this, if you installed the program:

$ man maze