[−][src]Module sudokul::board
board
contains data structures which store the state of a sudoku board.
Multiple different data structures are available, depending on your application's needs and
performance characteristics. All of these structures implement the board::Board
interface.
Generally, to start, it doesn't matter which one you pick, so going with OmniBoard is fine.
use sudokul::board::Board; use sudokul::board::OmniBoard; fn main() { let mut board = OmniBoard::new(); // use `set_entry` to set individual entries on the board, by (row, column). board.set_entry(0, 0, 1); board.set_entry(0, 1, 3); board.set_entry(0, 2, 5); // use `entry` to retrieve individual entries on the board, by (row, column). let entry01 = board.entry(0, 1); assert_eq!(entry01, 3); // use `row`/`column`/`square` to retrieve views of the board let row0 = board.row(0); let col0 = board.column(0); let sq0 = board.square(0); assert_eq!(row0[0], 1); assert_eq!(row0[1], 3); assert_eq!(row0[2], 5); assert_eq!(col0[0], 1); assert_eq!(col0[1], 0); assert_eq!(sq0[1], 3); }
Structs
LinearU8Board |
|
NanoBoard |
|
OmniBoard |
|
Traits
Board |
|