diff --git a/src/main.rs b/src/main.rs index c96bd09..3a90e4b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,6 +120,7 @@ impl core::str::FromStr for Parsed { enum SessionInstruction { Undo, + Hint, Klondike(KlondikeInstruction), } impl core::str::FromStr for SessionInstruction { @@ -127,6 +128,7 @@ impl core::str::FromStr for SessionInstruction { fn from_str(s: &str) -> Result { Ok(match s { "UNDO" | "undo" => Self::Undo, + "HINT" | "hint" => Self::Hint, other => { let Parsed(ki) = other.parse()?; Self::Klondike(ki) @@ -152,6 +154,11 @@ fn main() -> Result<(), std::io::Error> { // run game match instruction { SessionInstruction::Undo => session.undo(), + SessionInstruction::Hint => { + for instruction in session.possible_instructions() { + println!("{instruction:?}"); + } + } SessionInstruction::Klondike(instruction) => { if session.is_instruction_valid(instruction) { session.process_instruction(instruction);