1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
pub mod renderer;
pub static CLS: &'static str = "\x1B[2J";
pub static CLEAR_CURRENT_LINE: &'static str = "\x1B[2K";
pub static MOVE_BACK_ONE_LINE: &'static str = "\x1B[F";
pub static SAVE_CURSOR_POSITION: &'static str = "\x1B[s";
pub static RESTORE_CURSOR_POSITION: &'static str = "\x1B[u";
pub static RESET_COLOR: &'static str = "\x1B[0m";
pub const COL_INIT: usize = 3;
pub const COL_OFFSET: usize = 3;
pub const LINE_INIT: usize = 2;
pub const LINE_OFFSET: usize = 1;
pub const MAZE_ANIMATION_SPEED: u64 = 2;
pub const PATH_ANIMATION_SPEED: u64 = 150;
pub static NORTH_SPRITE: &'static str = "+---+";
pub static EAST_SPRITE: &'static str = "|";
pub static SOUTH_SPRITE: &'static str = "+---+";
pub static WEST_SPRITE: &'static str = "|";
static RED_FONT: &'static str = "\x1B[31m";
static GREEN_FONT: &'static str = "\x1B[32m";
static BLUE_FONT: &'static str = "\x1B[34m";
#[derive(Debug)]
pub enum Color {
RED,
GREEN,
BLUE,
}
impl Color {
fn as_str(&self) -> &'static str {
match *self {
Color::RED => RED_FONT,
Color::GREEN => GREEN_FONT,
Color::BLUE => BLUE_FONT,
}
}
}