show number of words in dictionary

This commit is contained in:
mehbark 2026-07-08 01:04:55 -04:00
parent 42290371eb
commit 6c709c59dc

View file

@ -9,6 +9,12 @@ use crate::letterset::LetterSet;
mod letterset; mod letterset;
fn main() { fn main() {
let search_limit = env::args()
.nth(1)
.and_then(|n| n.parse::<usize>().ok())
.unwrap_or(1000);
eprintln!("search depth: {search_limit}");
let mut dictionary: Vec<_> = BufReader::new(io::stdin().lock()) let mut dictionary: Vec<_> = BufReader::new(io::stdin().lock())
.lines() .lines()
.map(|line| { .map(|line| {
@ -17,13 +23,8 @@ fn main() {
(word, ls) (word, ls)
}) })
.collect(); .collect();
eprintln!("words: {}", dictionary.len());
let search_limit = env::args()
.nth(1)
.and_then(|n| n.parse::<usize>().ok())
.unwrap_or(1000);
eprintln!("search depth: {search_limit}");
let Some((len, path)) = solve(&mut dictionary, search_limit) else { let Some((len, path)) = solve(&mut dictionary, search_limit) else {
println!("failed :("); println!("failed :(");
process::exit(1); process::exit(1);