diff --git a/src/main.rs b/src/main.rs index c4e95a7..24c7792 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ use std::convert::TryInto; -use rand::seq::SliceRandom; #[macro_export] macro_rules! word { @@ -24,8 +23,6 @@ mod evaluator; fn play(dictionary: &Dictionary) { - let secret = *dictionary.choose(&mut rand::thread_rng()).unwrap(); - println!("The secret is {:?}", secret); let mut constraints = constraints::Total::new(); let mut game = game::Game { evaluator: &mut evaluator::AdversarialEvaluator::new(dictionary), @@ -43,13 +40,7 @@ fn play(dictionary: &Dictionary) { fn load_words(contents: &'static str) -> Vec> { contents .split("\n") - .map(|line| - line.chars() - .collect::>() - .as_slice() - .try_into() - .unwrap() - ) + .map(|line| word!(line)) .collect::>() }