LinuxCommandLibrary

gomoku

Play the Gomoku game

SYNOPSIS

gomoku [-V] [-n] [-b] [-h] [-c] [-l] [-f] [-r] [-v] [-t] [-s size] [-u undo_limit] [-x] [scorefile]

PARAMETERS

-V
    Display version information and exit.

-n
    Disable score recording for the game.

-b
    Configure the computer opponent to play as Black stones.

-h
    Configure the computer opponent to play as White stones (human plays Black, which is the default).

-c
    Set up a game where the computer plays against itself.

-l
    Enable learning mode, where the computer plays against itself to generate random games.

-f
    Allow the computer opponent to make the first move.

-r
    Re-randomize the initial seeds for game variation.

-v
    Enable verbose output during gameplay, showing more details.

-t
    Trace moves, displaying the board state after each move for debugging or analysis.

-s size
    Set the board size (e.g., -s 13 for a 13x13 board). The default size is 19x19.

-u undo_limit
    Set the maximum number of undos allowed per game (0 for unlimited undos; default is 3).

-x
    Exit immediately after a game concludes, without prompting for a replay.

scorefile
    Specify an alternative file path to save game scores (default: $HOME/.gomoku_scores).

DESCRIPTION

Gomoku is a strategy board game played on a grid, typically 19x19, where the objective is to be the first player to get an unbroken row of five of your stones either horizontally, vertically, or diagonally. The gomoku command-line utility provides a text-based interface to play this game in your terminal. It supports various game modes, including human vs. computer, computer vs. computer, and even a computer learning mode. Players can customize the board size, set undo limits, and view game traces. It also features score saving and offers various options for gameplay configuration and debugging. It is often distributed as part of the bsdgames package, bringing a traditional board game experience to the Linux command line.

CAVEATS

The gomoku command provides a purely text-based interface and relies on the curses library for terminal rendering, which might exhibit minor visual differences across various terminal emulators or systems. The computer opponent's strength is fixed within its design and not configurable via command-line parameters. While supporting various board sizes, the default is 19x19.

INTERACTION

During gameplay, players interact by entering coordinates for their moves (row and column). The game also supports various single-character commands for control:

  • q or Q: Quit the current game.
  • u or U: Undo the last move.
  • .: Replay the current game from the start.
  • !: Execute a shell command.
  • ^L: Redraw the screen.
  • ?: Display in-game help.
Moves are typically entered as row column (e.g., 10 10 to place a stone at the center of a 19x19 board).

HISTORY

The gomoku command is a classic Unix game, often bundled within the bsdgames package, tracing its origins back to the early days of Unix. It provides a straightforward, terminal-based implementation of the traditional Japanese board game. It was authored by John D. Polstra, contributing to the rich legacy of interactive command-line utilities available on Unix-like systems.

SEE ALSO

bsdgames(6), robots(6), trek(6)

Copied to clipboard