feat: adds game struct
This commit is contained in:
parent
5a7d66b52b
commit
8fb11f9bca
@ -10,6 +10,7 @@ struct Game {
|
||||
}
|
||||
|
||||
impl Game {
|
||||
#[allow(dead_code)]
|
||||
pub fn new(word: String, submitted_words: Vec<Vec<CharStatus<String>>>) -> Self {
|
||||
let result = submitted_words.clone().into_iter().last().map_or(GameResult::Lose, |w| if w.iter().all(|v| matches!(v, CharStatus::Match(_))) {
|
||||
GameResult::Win
|
||||
|
Loading…
x
Reference in New Issue
Block a user