LinuxCommandLibrary

nudoku

Play and solve Sudoku puzzles

TLDR

Start a sudoku game

$ nudoku
copy

Choose the difficulty of the game
$ nudoku -d [easy|normal|hard]
copy

Navigate the board
$ [<h>|<j>|<k>|<l>|<ArrowKeys>]
copy

Delete a number
$ [<Backspace>|<x>]
copy

Get a hint
$ <H>
copy

See the complete solution
$ <S>
copy

Create a new puzzle
$ <N>
copy

Quit the game
$ <Q>
copy

SYNOPSIS

nudoku [options]

PARAMETERS

-g [difficulty]
    Generate a Sudoku puzzle. The difficulty level can be specified. Possible values are: 'easy', 'medium', 'hard', 'extreme', or a number between 1 (easiest) and 10 (hardest). If no difficulty is specified, a random difficulty is chosen.

-s [puzzle]
    Solve a Sudoku puzzle. The puzzle must be provided as a string of 81 digits, with zeros or dots representing empty cells.

-v [puzzle]
    Verify the solution of a given Sudoku puzzle. The puzzle must be provided as a string of 81 digits.

-p [puzzle]
    Print a Sudoku puzzle in a user-friendly format. The puzzle must be provided as a string of 81 digits.

-n [number]
    Generate specified number of Sudoku puzzles.

-u
    Ensure the generated puzzle has a unique solution. (Default)

-h
    Display help message.

-V
    Display version information.

DESCRIPTION

nudoku is a command-line Sudoku puzzle solver and generator. It can solve existing Sudoku puzzles, generate new ones with varying difficulty levels, and present puzzles in a text-based format suitable for terminal use. nudoku is a useful tool for Sudoku enthusiasts who prefer working from the command line or need to automate Sudoku puzzle generation or solving.
The program's functionality includes the ability to specify difficulty levels, generate puzzles with unique solutions, and verify solutions to puzzles. nudoku provides options to customize the output format to make it easier to read and use in scripts or other applications. It is efficient and lightweight and well-suited for resource-constrained environments.

INPUT FORMAT

Sudoku puzzles are represented as a string of 81 characters. Each character represents a cell in the puzzle, read from left to right and top to bottom. Known values are represented by digits 1-9, and empty cells can be represented by either '0' or '.'.

EXAMPLES

To generate an easy puzzle: nudoku -g easy
To solve a puzzle: nudoku -s "53..7....6..195....98....6.8...6...34..8.3..17...2...6.6....28....419..5....8..79"

Copied to clipboard