Skip to content

Commit

Permalink
Add more public API functions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbergmark committed Jul 31, 2024
1 parent fc09e83 commit ee901e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hidden.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::error::SudokuError;
use crate::solver::place_and_propagate;
use crate::Sudoku;

pub(crate) fn place_all_hidden_singles(sudoku: &mut Sudoku) -> Result<(), SudokuError> {
pub fn place_all_hidden_singles(sudoku: &mut Sudoku) -> Result<(), SudokuError> {
place_hidden_singles_rows(sudoku)?;
place_hidden_singles_cols(sudoku)?;
place_hidden_singles_cells(sudoku)
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ mod triples;
mod visible;

pub use crate::error::SudokuError;
pub use crate::hidden::place_all_hidden_singles;
pub use crate::solver::{check_constraints, solve};
pub use crate::sudoku::Sudoku;
pub use crate::visible::{check_all_visible_doubles, place_all_visible_singles};
2 changes: 1 addition & 1 deletion src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn get_next_idx(sudoku: &Sudoku) -> Option<usize> {
}

#[inline]
fn check_constraints(sudoku: &mut Sudoku) -> Result<(), SudokuError> {
pub fn check_constraints(sudoku: &mut Sudoku) -> Result<(), SudokuError> {
check_triples(sudoku)?;
place_all_visible_singles(sudoku)?;
check_all_hidden_zeroes(sudoku)?;
Expand Down

0 comments on commit ee901e5

Please sign in to comment.