takuzu/lib.rs
1#![warn(missing_docs)]
2#![warn(rust_2018_idioms)]
3#![deny(unsafe_code)]
4
5//! A library for solving Takuzu (a.k.a. Binairo) number puzzles.
6//!
7//! # About
8//!
9//! Takuzu is a number puzzle, sometimes called binary sudoku.
10//! The objective is to fill a grid with `0`s and `1`s while
11//! observing the following rules:
12//!
13//! * no more than two zeros or two ones adjacent to each other in any direction.
14//! * each row and each column must contain an equal number of `0`s and `1`s.
15//! * no two rows and no two columns are the same.
16//!
17//! The grids are squares of even size.
18//! A valid grid must have one and only one solution.
19//! The solver will find and return all valid solutions though.
20//!
21//! # Input format
22//!
23//! For parsing, the grids must be represented with the following characters:
24//! `0`, `1`, `.` for a missing number, and one `\n` at the end of each row.
25//! The final `\n` may be omitted.
26//!
27//! [Example grids](https://github.com/letheed/takuzu/tree/master/grids)
28
29pub use ansi::AnsiGridDiff;
30pub use grid::{
31 cell::Cell,
32 error::{GridError, GridParseError, GridSizeError},
33 Grid,
34};
35
36mod ansi;
37mod grid;