5 releases

0.2.3 Jun 8, 2019
0.2.2 Jun 5, 2019
0.2.1 Jun 4, 2019
0.2.0 Jun 4, 2019
0.1.0 Jun 3, 2019

#699 in Games

MIT license

24KB
526 lines

sudoku-rs

sudoku solve lib

sudoku solve

use sudoku_rs::{board, solver};

let mut b = board::Board::new();
let s = solver::DfsSolver::new();
let mut s = solver::DfsSolver::new();
s.solve(&mut b);
println!("{}", b);

unique

use sudoku_rs::{board, solver};

let mut b = board::Board::new();
let mut s = solver::DfsSolver::new();
assert!(!s.unique(&mut b).unwrap());

grade

use sudoku_rs::{board, grade};

let mut b = board::Board::new();
let g = grade::Grade::new();
let scores = g.grade(&mut b);
println!("{:?}", scores);

next to do

  • dfs solve
  • unique check
  • sudoku grade
  • sudoku gen

lib.rs:

a lib for sudoku

sudoku solve

use sudoku_rs::{board, solver};

let sudoku_str = "400000805030000000000700000020000060000080400000010000000603070500200000104000000";
let mut b: board::Board = sudoku_str.parse().unwrap();
let s = solver::DfsSolver::new();
s.solve(&mut b);
println!("{}", b);

unique

use sudoku_rs::{board, solver};

let mut b = board::Board::new();
let s = solver::DfsSolver::new();
assert!(!s.unique(&mut b).unwrap());

grade

use sudoku_rs::{board, grade};

let mut b = board::Board::new();
let g = grade::Grade::new();
let scores = g.grade(&mut b);
println!("{:?}", scores);

No runtime deps