From 76ff849a8c700b62cf4d4c1a78877d1f88d0d960 Mon Sep 17 00:00:00 2001 From: ashastral Date: Sat, 26 Feb 2022 22:08:54 -0800 Subject: [PATCH] clean up main --- src/main.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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::>() }