sudoku_solver/lib.rs
1pub mod solver;
2mod sudoku;
3pub mod utils;
4
5pub use solver::SudokuSolver;
6pub use sudoku::{Step, Sudoku};
7
8use wasm_bindgen::prelude::*;
9
10#[cfg(feature = "wee_alloc")]
11#[global_allocator]
12static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
13
14#[wasm_bindgen]
15pub fn sudoku_one_step(sudoku: &str) -> Option<Step> {
16 let sudoku = Sudoku::from_values(sudoku);
17 let solver = SudokuSolver::new(sudoku);
18 solver.solve_one_step()
19}