feat(web): solver input
This commit is contained in:
+14
-3
@@ -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("{:<} | {:<}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user