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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
use anyhow::bail;
use std::{
io::{self, Write},
thread,
time::Duration,
};
use terminal_size::{terminal_size, Height, Width};
fn clear_screen() {
print!("\x1B[2J\x1B[1;1H");
}
#[allow(clippy::too_many_lines)]
pub fn cmd() -> anyhow::Result<()> {
if let Some((Width(w), Height(h))) = terminal_size() {
if w < 180 || h < 40 {
bail!("Window size is too small, are you working from PSP? Set it at least for 120x40 symbols (≈800x800).");
}
}
let bike1 = r"
(|
||_
=///`\
(\ \\\) |
__\\ `|~~|
(((<_| ____ | |
`-__/\ /~ ~\| |
\ ~-_ |--| |___|
`\ ~-_ |_/ /--__/
`\/ / ~-_\___--/ /
`-_ ~/ / /
~-_ / | _/
| |
|~~~~~-----|
|___----~~~/
_-~~\ \_ /
/(_|_-~ | /
/ /~==[]\ ____-------_ |_____--| ______________
/ (_ //(\0)~~~~ BMW ~\ /_- \/' ___/ ~~~~/
(| ~~--__ |/ )_____---~~~ YZF \
\. ___ ~~--__ ____ / _-/ __--~~'
~\ \\\\ ~~-_ ~-____ / _-~~ __--~~___
_ ----/ \ \\\\ ~-_ /---__-~ __--~~----~~_ ]=
_-~ ___ / /__\ ~~~ ~-_ ( )-~ ~-_~~~/~~~ _-~ ~-_
/-~~~_-|/ / ~\ _) ~-_ \ /~~~~~---__-----_ \
; / \/_//`\ \ __--~~/_ \~-_ _-\ ~~~~~~~~~~~~-/_/\ .
| | \((*))/ | |\ __--~~ /o \ `\ ~- `\----_____( 0) ) | |
| \ |~| / | )-~~ \ 0 ) |/' _-~/~--------| |~ / ,
\ ~-----~ / / ~~~~~~~~/_/O_/' \ ~-----~ /
~-_ _-~ `---------------------------' `-_ _-~
~ ----- ~ ~ ----- ~
";
let bike2 = r"
___
/~ ~\
|_ |
|/ __-__
\ /~ ~~-_
~~ -~~\ ~\
/ | \
, / / \
// _ _---~~~ //-_ \
/ (/~~ ) _____/-__ ~-_ _-\ _________
/ _-~\\0) ~~~~ ~~-_ \__--~~ `\ ___---~~~ /'
/_-~ BMW _-/' )~/ /'
(___________/ _-~/' _-~~/ _-~
_ ----- _~-_\\\\ _-~ /' __--~ (_ ______---~~~--_
_-~ ~-_~\\\\ ( ( -_~ ~-_ | ~-_
/~~~~\ \ \~~ ~-_ ~-_ ~\ ~~--__-----_ \
; / \ ______-----\ ~-__~-~~~~~~--_ ~~--_ \ .
| | \((*)~~~~~~~~~~| __--~~ ~-_ ) | |
| \ |~|~---------)__--~~ \_____________/ / ,
\ ~-----~ / /~ ) \ ~-----~ /
~-_ _-~ /_______________________________/ `-_ _-~
~ ----- ~ ~ ----- ~
";
let biker_stop = r"
____
/ -- \
||__||
|____|
___) (___
XXXXX XXXXX
XX (XXXXXX) XX
XX XXXXXX XX
XX XXXX XX
XX HHHH XX
M HHHHHH M ___
HHH HHH ==|___|==
HHH HHH \___/
HHH HHH O--(( ))--O
HHH HHH \nnn/
HHH HHH n n
HHH HHH /O\
HHH HHH OOO
HHH HHH OOO
VVV VVV OOO
|V/ \V/ OOO
/_/| |\_\ \O/
";
let biker_no_more = r"
==|___|==
\___/
O--(( ))--O
\nnn/
n n
/O\
OOO
OOO
OOO
OOO
\O/
Hello :)
My name is Eugene, I am the author of Pike.
If you stumbled upon this command by accident, you might have been overworking lately,
I strongly recommend you to rest well and don't work on weekends :)
Make your life a ride and enjoy the life, which, alas, not infinite.
This is my final message, farewell.
";
let width = 100;
for pos in (0..width).rev() {
clear_screen();
let sprite = if pos > width / 2 { bike1 } else { bike2 };
for line in sprite.lines() {
println!("{:>width$}", line, width = pos + line.len());
}
io::stdout().flush().unwrap();
thread::sleep(Duration::from_millis(80));
}
clear_screen();
println!("{biker_stop}");
io::stdout().flush().unwrap();
let phrases = [
"Hello :)",
"My name is Eugene, I am the author of Pike.",
"If you stumbled upon this command by accident, you might have been overworking lately,",
"I strongly recommend you to rest well and don't work on weekends :) ",
"Make your life a ride and enjoy the life, which, alas, not infinite.",
"This is my final message, farewell.",
];
for phrase in phrases {
println!("{phrase}");
thread::sleep(Duration::from_secs(3));
}
clear_screen();
println!("{biker_no_more}");
thread::sleep(Duration::from_secs(3));
io::stdout().flush().unwrap();
Ok(())
}