Add some verbose
This commit is contained in:
parent
b1c1bd880f
commit
c520e46dff
1 changed files with 5 additions and 2 deletions
7
map.c
7
map.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue