Crate takuzu [] [src]

A Takuzu (a.k.a. Binairo) solving library.

About

Takuzu is a number puzzle, sometimes called binary sudoku. The objective is to fill a grid with 0s and 1s while observing the following rules:

  • no more than two of either number adjacent to each other in one direction.
  • each row and each column must contain an equal number of 0s and 1s.
  • no two rows and no two columns are the same.

The grids are squares of even size. A valid grid must have one and only one solution. The solver will find and return all the valid solutions though.

Format

The grid must be represented with the following characters: 0, 1, . for a missing number, and one \n at the end of each row. (The final \n may be omitted though.)

Example grids

Modules

error

All the error types of the crate are exported in this module.

Structs

Grid

An opaque container for takuzu grid manipulation.

Enums

Cell

An enum representing the state of a cell.

Traits

Source

The Source trait allows to use any implementor of the Read trait as an input source for the grid string format with no additional effort.