Skip to content

MatthewCushing/Pacman-Progress-Bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Pacman Progress Bar

This is a simple Progress Bar that I wrote that you can use in your C++ software that runs in the terminal. It's extremely easy to use.

  1. Clone this repo
  2. Take the header and implementation file and put it wherever you like in your software
  3. #include "PacmanProgressBar.h
  4. Call the progressBar function inside of your program
  5. There are only two parameters that both hold a uint32_t

The first parameter is the index. Most likely you will be putting this in a loop and so your i variable will be the index in your for loop. The second parameter is the total number of iterations. So if you are iterating through an array, it would be the total length of the array.

Example:

#include "PacmanProgressBar.h"
#include <array>

int main() {
    std::array<int> myArray[2000000];

    for (size_t i{0}; i < myArray.size(); ++i) {
        myArray[i] = i;
        ProgressBar(i, myArray.size());
    }
}

That's it. Really simple and basic. You can obviously use this in more complex applications and most likely find uses for it other than a loop. I use it in all my testing applications at work.

About

Progress Bar I made that takes two

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages