sudoku_solver/solver/fish/
mod.rs1mod fish_utils;
2mod franken_fish;
3mod mutant_fish;
4mod simple_fish;
5
6use crate::solver::return_if_some;
7use crate::sudoku::StepRule;
8use crate::{Step, SudokuSolver};
9
10pub fn solve_basic_fish(sudoku: &SudokuSolver) -> Option<Step> {
14 for size in 2..=4 {
15 for value in 1..=9 {
16 return_if_some!(simple_fish::search_simple_fish(
17 sudoku,
18 size,
19 value,
20 StepRule::BasicFish
21 ));
22 }
23 }
24 None
25}
26
27pub fn solve_finned_fish(sudoku: &SudokuSolver) -> Option<Step> {
28 for size in 2..=4 {
29 for value in 1..=9 {
30 return_if_some!(simple_fish::search_simple_fish(
31 sudoku,
32 size,
33 value,
34 StepRule::FinnedFish
35 ));
36 }
37 }
38 None
39}
40
41pub fn solve_franken_fish(sudoku: &SudokuSolver) -> Option<Step> {
42 for size in 3..=4 {
44 for value in 1..=9 {
45 return_if_some!(franken_fish::search_franken_fish(sudoku, size, value));
46 }
47 }
48 None
49}
50
51pub fn solve_mutant_fish(sudoku: &SudokuSolver) -> Option<Step> {
52 for size in 3..=4 {
53 for value in 1..=9 {
54 return_if_some!(mutant_fish::search_mutant_fish(sudoku, size, value));
55 }
56 }
57 None
58}