LinuxCommandLibrary

nbsudoku

Play and solve Sudoku puzzles

SYNOPSIS

nbsudoku [-g] [-h] [-s] [-v] [PUZZLE]

PARAMETERS

-g
    Generate a random puzzle

-h
    Show summary of options

-s
    Solve the given puzzle

-v
    Show version of program

PUZZLE
    81-char Sudoku grid string (row-major, '.'/'0' for empties)

DESCRIPTION

nbsudoku is a lightweight, terminal-based program for playing and solving Sudoku puzzles using the ncurses library. It offers an interactive console interface ideal for users preferring distraction-free gameplay without graphical dependencies.

Launch without options to play a puzzle provided as an 81-character string in row-major order ('.' or '0' for empties). Use -g to generate a random puzzle. The -s option enables the solver for automatic resolution. Navigation uses arrow keys or hjkl; digits 1-9 fill cells; space toggles candidate notes; other keys provide hints, checks, restarts, and more.

Perfect for servers, tmux sessions, or minimal environments, it supports standard 9x9 grids with pencil-marking for advanced play. Puzzles can be piped or copy-pasted. Version info via -v; help with -h. No installation of heavy software needed—just the nbsudoku package.

CAVEATS

Requires ncurses-compatible terminal (min ~80x24). No support for variants like 6x6 grids.

GAME CONTROLS

Arrow keys/hjkl: move cursor
1-9: enter number
Space: toggle candidate note
?: hint
c: clear errors
r: restart
n: new puzzle
q: quit
s: solve

PUZZLE INPUT

Example: nbsudoku '....5.8..9.3.4..1...7..84.3...9..5.1.6......7.2..4...3.68..7.9.2....4.3..8.5....'
Pipe via echo 'puzzle' | nbsudoku

HISTORY

Developed by Jef Dings (<jef@tcfs.be>); initial release ~2005. Packaged in Debian, Arch AUR, and others.

SEE ALSO

sudoku(6)

Copied to clipboard