Add some verbose

This commit is contained in:
Ethanell 2019-12-20 09:29:57 +01:00
parent b1c1bd880f
commit c520e46dff

7
map.c
View file

@ -35,8 +35,8 @@ int main(int argc, char **argv) {
fprintf(ftpr, "%ld%c%c%c\n", l, e, o, f); fprintf(ftpr, "%ld%c%c%c\n", l, e, o, f);
srand(time(NULL)); srand(time(NULL));
for (unsigned int i=0; i<l; i++) { for (unsigned long i=0; i<l; i++) {
for (unsigned int j=0; j<c; j++) { for (unsigned long j=0; j<c; j++) {
if (rand()%100 > op) { if (rand()%100 > op) {
line[j] = e; line[j] = e;
} else { } else {
@ -44,7 +44,10 @@ int main(int argc, char **argv) {
} }
} }
fwrite(line, sizeof(char), c+1, ftpr); fwrite(line, sizeof(char), c+1, ftpr);
fflush(stdout);
printf("\r%.0f%%", ((float)i/(float)l)*100);
} }
printf("\n");
fclose(ftpr); fclose(ftpr);
free(line); free(line);