feat(web): solver input

This commit is contained in:
2026-08-20 19:04:10 +02:00
parent ae2cf56081
commit 27c308d632
4 changed files with 151 additions and 33 deletions
+14 -3
View File
@@ -7,9 +7,9 @@ use crate::word_list::WordList;
use derive_more::Display;
use tabular::{Row, Table};
struct Guess {
pattern: Pattern,
information_gained: f64,
pub struct Guess {
pub pattern: Pattern,
pub information_gained: f64,
}
pub struct Solver {
@@ -141,6 +141,17 @@ impl Solver {
table.to_string()
}
pub fn guesses(&self) -> &Vec<Guess> {
&self.guesses
}
pub fn stats(&self) -> (u64, f64) {
(
self.possible_solutions.len() as u64,
self.possible_solutions.equal_likelieness_entropy(),
)
}
pub fn tabular_format(&self) -> String {
let mut table = Table::new("{:<} | {:<}");