Manual browser: gomoku(6)

GOMOKU(6) Games Manual GOMOKU(6)


gomokugame of 5 in a row


gomoku [-bcdu] [-D debugfile] [savefile]


gomoku is a two player game where the object is to get 5 in a row horizontally, vertically or diagonally on a 19 by 19 grid. By convention, black always moves first.

The options are:

Run in batch mode. (See below.)
Computer versus computer. gomoku will play a game against itself. This is mostly used for testing.
Print debugging information. Repeating this option more than once yields more detailed information.
-D debugfile
Print the debug information to debugfile instead of to the standard output.
User versus user. (Play against yourself.) This is mostly used for testing.
Load a previously saved game from savefile.

With no arguments, gomoku starts a fresh user vs. computer game.

Moves may be entered by selecting the desired board location and pressing the space or enter key. The cursor may be moved using the arrow keys or vi(1) motion keys hjklyubn. These also may be familiar from rogue(6) and hack(6). To quit, type ‘Q’, and to save the game, type ‘S’ and supply a file name when prompted.

Batch mode

Batch mode was intended for game tournaments where a referee program handles the board display and pits one program against another. In this mode, gomoku reads moves from standard input and writes its responses to standard output. The first line of input should be either “black” or “white” to specify whether gomoku has the first move or not respectively.


Ralph Campbell


The board display routines were based on the goref program written by Peter Langston. The user interface was based on Eric S. Raymond's interface for bs.
March 28, 2010 NetBSD 7.0