Last active
August 16, 2016 08:21
-
-
Save hb3p8/1791e7495ba6ab1d9c242c07d56e50b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float aProgress = 0.0; | |
while (aProgress < 1.0) { | |
int aBarWidth = 70; | |
std::cout << "["; | |
int aPos = (int) (aBarWidth * aProgress); | |
for (int i = 0; i < aBarWidth; ++i) { | |
if (i < aPos) std::cout << "="; | |
else if (i == aPos) std::cout << ">"; | |
else std::cout << " "; | |
} | |
std::cout << "] " << (int) (aProgress * 100.0) << " %\r"; | |
std::cout.flush(); | |
aProgress += 0.16; // for demonstration only | |
} | |
std::cout << std::endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment