forked from sol-prog/Perlin_Noise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84f3a09
commit 24083c8
Showing
5 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
#define PBSTR "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" | ||
#define PBWIDTH 60 | ||
#define GRN "\x1B[32m" | ||
#define RESET "\x1B[0m" | ||
|
||
void printProgress(double percentage) | ||
{ | ||
int val = (int)(percentage * 100); | ||
int lpad = (int)(percentage * PBWIDTH); | ||
int rpad = PBWIDTH - lpad; | ||
printf("\r%3d%% [" GRN "%.*s%*s" RESET "]", val, lpad, PBSTR, rpad, ""); | ||
fflush(stdout); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef PROGRESSBAR_H | ||
#define PROGRESSBAR_H | ||
|
||
void printProgress(double percentage); | ||
|
||
#endif |