Formatted sample

This commit is contained in:
Pranav Srinivas Kumar
2019-12-04 09:40:09 -06:00
parent 30226da135
commit 36d122fa17

View File

@@ -19,9 +19,7 @@ int main() {
p1.color(ProgressBar::Color::YELLOW); p1.color(ProgressBar::Color::YELLOW);
std::atomic<size_t> index1{0}; std::atomic<size_t> index1{0};
std::vector<std::string> status_text1 = std::vector<std::string> status_text1 = {"Rocket.exe is not responding",
{
"Rocket.exe is not responding",
"Buying more snacks", "Buying more snacks",
"Finding a replacement engineer", "Finding a replacement engineer",
"Assimilating the modding community", "Assimilating the modding community",
@@ -29,8 +27,7 @@ int main() {
"Porting KSP to a Nokia 3310", "Porting KSP to a Nokia 3310",
"Flexing struts", "Flexing struts",
"Releasing space whales", "Releasing space whales",
"Watching paint dry" "Watching paint dry"};
};
auto job1 = [&p1, &index1, &status_text1]() { auto job1 = [&p1, &index1, &status_text1]() {
while (true) { while (true) {
@@ -59,7 +56,8 @@ int main() {
p3.show_percentage(false); p3.show_percentage(false);
auto job3 = [&p3]() { auto job3 = [&p3]() {
while (true) { while (true) {
p3.start_with("Reading package list... " + std::to_string(p3.current()) + "% "); p3.start_with("Reading package list... " + std::to_string(p3.current()) +
"% ");
if (p3.current() + 2 >= 100) if (p3.current() + 2 >= 100)
p3.start_with("Reading package list... Done"); p3.start_with("Reading package list... Done");
p3.tick(); p3.tick();
@@ -136,7 +134,8 @@ int main() {
// //
// PROGRESS BAR 4 // PROGRESS BAR 4
// //
std::vector<std::string> lead_spinner{"", "", "", "", "", "", "", "", "", ""}; std::vector<std::string> lead_spinner{"", "", "", "", "",
"", "", "", "", ""};
ProgressBar p4; ProgressBar p4;
p4.bar_width(50); p4.bar_width(50);
p4.start_with("["); p4.start_with("[");