Skip to content

Instantly share code, notes, and snippets.

@codemedic
Last active September 28, 2020 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codemedic/79c37820caf247479cb7b0bfa314f7f0 to your computer and use it in GitHub Desktop.
Save codemedic/79c37820caf247479cb7b0bfa314f7f0 to your computer and use it in GitHub Desktop.
Blow bubbles with C++
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