Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io::Write;

pub fn prompt() {
    let mut input = String::new();
    loop {
        print!(">");
        std::io::stdout().flush().unwrap();

        input.clear();
        std::io::stdin().read_line(&mut input).unwrap();
        if input.trim() == "xyzzy" {
            println!("A hollow voice says 'fool'.");
            break;
        } else {
            println!("beg pardon");
        }
    }
}