Updated alien spaceship sample

This commit is contained in:
Pranav Srinivas Kumar
2019-12-04 10:54:25 -06:00
parent 36d122fa17
commit 4f2a85d9b7

View File

@@ -1,11 +1,51 @@
#include <progress/bar.hpp>
#include <vector>
/*
[
"|/-\\",
"⠂-–—–-",
"◐◓◑◒",
"◴◷◶◵",
"◰◳◲◱",
"▖▘▝▗",
"■□▪▫",
"▌▀▐▄",
"▉▊▋▌▍▎▏▎▍▌▋▊▉",
"▁▃▄▅▆▇█▇▆▅▄▃",
"←↖↑↗→↘↓↙",
"┤┘┴└├┌┬┐",
"◢◣◤◥",
".oO°Oo.",
".oO@*",
["🌍", "🌎", "🌏"],
"◡◡ ⊙⊙ ◠◠",
"☱☲☴",
"⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏",
"⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓",
"⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆",
"⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋",
"⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁",
"⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈",
"⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈",
"⢄⢂⢁⡁⡈⡐⡠",
"⢹⢺⢼⣸⣇⡧⡗⡏",
"⣾⣽⣻⢿⡿⣟⣯⣷",
"⠁⠂⠄⡀⢀⠠⠐⠈",
["🌑", "🌒", "🌓", "🌔", "🌕", "🌝", "🌖", "🌗", "🌘", "🌚"],
["🕛", "🕐", "🕑", "🕒", "🕓", "🕔", "🕕", "🕖", "🕗", "🕘", "🕙", "🕚"]
]
*/
int main() {
// Hide cursor
std::cout << "\e[?25l";
{
}
//
// PROGRESS BAR 1
//
@@ -108,20 +148,24 @@ int main() {
ProgressBar p5;
p5.bar_width(100);
p5.start_with("🌏");
p5.fill_progress_with("·");
p5.fill_progress_with("-");
p5.lead_progress_with("🛸");
p5.fill_remainder_with(" ");
p5.end_with("🌑");
p5.show_percentage(true);
p5.color(ProgressBar::Color::WHITE);
auto job5 = [&p5]() {
std::atomic<int> trail_index{0};
std::vector<std::string> trail {"", "", "", ""};
auto job5 = [&p5, &trail, &trail_index]() {
while (true) {
if (p5.current() % 5 == 0) {
p5.fill_progress_with("·");
} else {
p5.fill_progress_with(" ");
}
p5.lead_progress_with(
trail[(trail_index - 3) % trail.size()] +
trail[(trail_index - 2) % trail.size()] +
trail[(trail_index - 1) % trail.size()] +
trail[trail_index % trail.size()] +
"🛸");
p5.tick();
trail_index += 1;
if (p5.completed()) {
break;
}