generated from PlexSheep/rs-base
guess response
This commit is contained in:
parent
a3e348ba91
commit
ad0bd8b309
|
@ -1,6 +1,10 @@
|
||||||
use crate::wlist::word::{Frequency, Solution, Word};
|
use crate::wlist::word::{Frequency, Solution, Word};
|
||||||
use crate::wlist::WordList;
|
use crate::wlist::WordList;
|
||||||
|
|
||||||
|
use self::response::GuessResponse;
|
||||||
|
|
||||||
|
pub mod response;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct Game<WL>
|
pub struct Game<WL>
|
||||||
where
|
where
|
||||||
|
@ -44,6 +48,16 @@ impl<WL: WordList> Game<WL> {
|
||||||
|
|
||||||
Ok(game)
|
Ok(game)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn reset(mut self) -> Self {
|
||||||
|
self.solution = self.wordlist.rand_solution();
|
||||||
|
self.step = 0;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn guess(&mut self, word: Word) -> anyhow::Result<GuessResponse> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build and Configure a [`Game`]
|
/// Build and Configure a [`Game`]
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
use crate::wlist::word::Word;
|
||||||
|
|
||||||
|
pub struct GuessResponse {
|
||||||
|
guess: Word,
|
||||||
|
status: Vec<(char,Status)>
|
||||||
|
step: usize
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum Status {
|
||||||
|
None,
|
||||||
|
Exists,
|
||||||
|
Matched
|
||||||
|
}
|
Loading…
Reference in New Issue