feat: adds game struct

This commit is contained in:
itsscb 2024-08-22 15:15:40 +02:00
parent 5a7d66b52b
commit 8fb11f9bca

View File

@ -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