update interesting criteria

This commit is contained in:
ashastral 2022-03-08 16:52:25 -08:00
parent 52260db5e8
commit 794d864c3f
2 changed files with 15 additions and 8 deletions

View file

@ -36,12 +36,6 @@ impl<const N: usize> Puzzle<N> {
game.push(result); game.push(result);
game_history.push(result); game_history.push(result);
if game_history.len() > 2 { if game_history.len() > 2 {
if result.matches
.iter()
.filter(|&m| *m == LetterMatch::HERE)
.count() < 3 {
continue;
}
let possible_words = game.guesser.get_possible_words(); let possible_words = game.guesser.get_possible_words();
let interesting_solutions = Puzzle::interesting(dictionary, &game_history, possible_words); let interesting_solutions = Puzzle::interesting(dictionary, &game_history, possible_words);
if interesting_solutions.is_some() { if interesting_solutions.is_some() {
@ -67,6 +61,14 @@ impl<const N: usize> Puzzle<N> {
return None; return None;
} }
let heres = history.last().unwrap().matches
.iter()
.filter(|&m| *m == LetterMatch::HERE)
.count();
if heres < 3 {
return None;
}
let base_constraints = &mut constraints::Total::new(); let base_constraints = &mut constraints::Total::new();
let constraints = &mut constraints::Total::new(); let constraints = &mut constraints::Total::new();
let mut evaluator = evaluator::AdversarialEvaluator::new(dictionary); let mut evaluator = evaluator::AdversarialEvaluator::new(dictionary);
@ -92,8 +94,13 @@ impl<const N: usize> Puzzle<N> {
} }
} }
let max_solutions = match heres {
4 => 20,
3 => 100,
_ => panic!(),
};
let solution_count = solutions.len(); let solution_count = solutions.len();
let interesting = solution_count > 0 && solution_count <= 100; let interesting = solution_count > 0 && solution_count <= max_solutions;
if interesting { if interesting {
Some(solution_count) Some(solution_count)

View file

@ -21,7 +21,7 @@ impl PuzzleOutput {
fn main() { fn main() {
let common_words: Vec<Word<5>> = wordlelike::load::load_words(include_str!("../../wordlelike/src/words/common.txt")); let common_words: Vec<Word<5>> = wordlelike::load::load_words(include_str!("../../wordlelike/src/words/common.txt"));
for seed in 0..=365 { for seed in 11..=365 {
let puzzle = Puzzle::generate(&common_words, seed); let puzzle = Puzzle::generate(&common_words, seed);
println!("{}", serde_json::to_string(&PuzzleOutput { println!("{}", serde_json::to_string(&PuzzleOutput {
history: puzzle.history history: puzzle.history