summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--a.exebin0 -> 55155 bytes
-rw-r--r--congrats_animation.c12
2 files changed, 12 insertions, 0 deletions
diff --git a/a.exe b/a.exe
new file mode 100644
index 0000000..b98caf9
--- /dev/null
+++ b/a.exe
Binary files differ
diff --git a/congrats_animation.c b/congrats_animation.c
index 34a1905..67c3d0b 100644
--- a/congrats_animation.c
+++ b/congrats_animation.c
@@ -1,19 +1,31 @@
#include <stdio.h>
+#include <time.h>
#include <unistd.h>
#define DISTANCE 10
#define DOWNTIME 100000
int main(){
int i, j;
+ int num_rand; //for random color
+ int counter = 1; //change color when hits 5
+
+ srand(time(NULL));
while(1){
for(i = 0; i < DISTANCE; i++){
+ counter++;
+
for(j = 0; j < 15+i+1; j++){
printf("\b \b"); //backspace
}
for(j = 0; j < i; j++){
printf(" ");
}
+ if(counter == 5){
+ num_rand = (rand() % 7) + 1;
+ printf("\e[0;3%dm", num_rand);
+ counter = 1;
+ }
printf("Congratulations");
fflush(stdout);
usleep(DOWNTIME);