Last active
September 28, 2020 19:07
-
-
Save codemedic/79c37820caf247479cb7b0bfa314f7f0 to your computer and use it in GitHub Desktop.
Blow bubbles with C++
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
void | |
blow_bubbles_till(bool& condition) | |
{ | |
static const char* sprite = ". o O @ *"; | |
unsigned frame = 0; | |
while (!condition) { | |
boost::this_thread::sleep_for(boost::chrono::milliseconds(250)); | |
std::cerr << "\r‗‗" << std::string(sprite + frame * 5, 5) << ' '; | |
frame = (frame + 1) % 5; | |
} | |
std::cerr << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment