Skip to content

Commit

Permalink
construct AdvancedSolver from state
Browse files Browse the repository at this point in the history
  • Loading branch information
Nervonment committed Jun 9, 2024
1 parent afb3e88 commit e0e3f9d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/solver/advanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,28 @@ where
}
}

impl<T> From<T> for AdvancedSolver<T>
where
T: State
+ Fillable
+ CandidatesSettable
+ TrackingCandidates
+ TrackingCandidateCountOfCell
+ TrackingCellCountOfCandidate,
{
fn from(state: T) -> Self {
Self {
puzzle: state.grid(),
state,
solution_cnt: 0,
tmp_score: 0.0,
tmp_max_tech_score: 1.0,
score: 0.0,
max_tech_score: 0.0,
}
}
}

impl<T> Solver for AdvancedSolver<T>
where
T: State
Expand Down

0 comments on commit e0e3f9d

Please sign in to comment.