[−][src]Module intfic::parse_input
Sanitizes and parses input, checking for system keywords.
Enums
Answer | Yes, No, or Unsure. Corresponds with a dictionary of responses that indicate one of these three answers. |
Direction | Cardinal directions, as well as Up, Down, and Return. Corresponds with a dictionary of responses. |
Functions
ask_direction | Asks for a direction and returns Some(Answer) if the user doesn't type a keyword. |
ask_question | Asks a given yes-no question and returns Some(Answer) if the user doesn't type a keyword. |
get_input | Gets input from the user and checks if it matches a keyword (returns None) or else returns Some(String). |
query | Returns true if the given dictionary contains the given input string. |
sanitize | Returns a lowercase string containing only alphanumeric characters and spaces. |