freesweep — a curses minesweeper-style game

Synopsis

freesweep
[-% value] [-a] [-f | -i] [-h value] [-m value] [-s] [-w value] [--alt-charset] [--fast] [--height=value] [--interactive | --save-prefs] [--mines=value] [--percent=value] [--width=value]
freesweep
[-a] [-b | -d] [--alt-charset] [--dump-best-times | --show-best-times]
freesweep
[-a] [-g] [--show-gpl]
freesweep
[-v] [--version]
freesweep
[-H] [--help]

Description

freesweep is a curses-based minesweeper game for *nix.

Options

-% value, --percent=value
Sets the number of mines to value percent of the number of squares on the board, rounded to the nearest integer. This option cannot be used with the -m or --mines options.
-a, --alt-charset
Switch character sets between standard ASCII and PC-style linedraw characters. Use of this option on the command line indicates that the character set should be the set not specified in the preferences file. See the FILES section below.

The character set can also be toggled during play using the 'a' key, which can be useful when a terminal fails to have the PC-style linedraw character set. See the COMMANDS section below.

-b, --show-best-times
Use the curses best times viewer rather than starting a game, then exit.

The best times viewer can also be accessed during play by selecting the 'b' key. See the COMMANDS section below.

-d, --dump-best-times
Print the list of best times, sorted in descending order to stdout. More information will be placed in this manual page regarding the column format when it has been clearly established.
-f, --fast
This option bypasses the interactive dialog normally run initially. All values must either be specified on the command line or in the preferences files.
-g, --show-gpl
Display the GNU General Public License, in a nice curses page viewer. Currently version 2 of the license is displayed; however, freesweep is licensed under version 2 or later of the GNU GPL, so this license may be superseded in the future.
-H, --help
Print the lost of valid command line options, then exit.
-h value, --height=value
Set height to value. If the interactive dialog is run initially, any value passed for height will be listed as the default.
-i, --interactive
Force the interactive menu to be run initially. This is primarily used to override the FastStart option specified in the preferences file. It cannot be used with the -f-fP or --fast options.
-m value, --mines=value
Set the number of mines to value. This option cannot be used with the -% or --percent options.
-s, --save-prefs
Save any preferences passed on the command line. This option is normally used with the FastStart option (specified with -f or --fast)
-v, --version
Display version information and exit. Use of this option overrides all other options.
-w value, --width=value
Set width to value. If the interactive dialog is run initially, any value passed for width will be listed as the default.

Commands

When started normally, freesweep will conduct a dialog to query the following information from the player: height and width of the board, number of mines (as either an integer or in terms of size of the board), if PC-style line drawing characters are to be used, if future games should use FastStart mode, how to announce alerts (beep, visual bell, or none), and if the newly entered preferences should be saved. This dialog is skipped if the -f or --fast flags are passed, or if the FastStart option is selected in the preference file.

In normal play, freesweep waits for keystrokes, and then reacts according to the received value. Some keystrokes may be modified by a preceding integer; these are noted in the list below by a preceding n. The following keystroke values are valid:

n<arrow key>, nh, nj, nk, nl
The arrow keys move the cursor n squares in the corresponding direction, as limited by the boundaries of the playing field. A warning is issued should this occur. The default integer is one.

The vi-style motion keys h, j, k, and l are also accepted, and are equivalent to the arrow keys.

a
Toggle between the standard ASCII character set and PC-style linedraw.
b
Display the best times list, one screenful at a time. The game clock is suspended for the duration of the best times viewer.
g
Display the GNU General Public License, version 2. The game clock is suspended for the duration of the viewing of the GNU GPL. The text is displayed one screenful at a time; 'q' returns to game play, any other key advances to the next screenful.
?
Display a help screen, containing a listing of valid commands. The game clock is suspended for the duration of the viewing of this screen.
f
Toggle flagging the current square as a mine. Flagged squares cannot be exposed.
<space>

Files

~/.sweeprc
The user's sweep resource file.
~/.sweeptimes
The user's sweep best times file.
/etc/sweeprc
The global default sweep resource file.
/var/games/sweeptimes
The shared best times file.

The global preference file is read first, then the player's preference file. Any command line options are considered next, and lastly any input from the interactive dialog.

Authors

Gus Hartmann <hartmann@upl.cs.wisc.edu>
Pete Keller <psilord@upl.cs.wisc.edu>

Credits

This program would not have been written had there been more machines capable of running X Windows in the lab where I learned to program, the Undergraduate Project Lab at the University of Wisconsin Department of Computer Sciences

Bugs

The best times code is currently only partially implemented.

The viewer for the GNU GPL and the best times cannot go backwards.

This manual page always includes the GNU-style long options, even on systems which do not support them.

Other bugs should be reported to <sweep@cs.wisc.edu>.