reuse the same line of text when showing progress

This commit is contained in:
Alex Thannhauser 2025-06-12 10:49:30 -05:00
parent c57232fee6
commit 33b497d0a2

15
main.c
View file

@ -478,9 +478,19 @@ void calculate_simplifications(void)
{
int left = N - todo_n;
if (print_with_color)
{
printf("\e[2K");
}
printf("%i of %i (%.2f%%): [%i] ", left, N, (100.0 * left / N), cost);
print(truthtable, 0), puts("");
if (print_with_color)
{
printf("\e[1A");
}
}
// consider NOT:
@ -670,6 +680,11 @@ void calculate_simplifications(void)
}
}
}
if (verbose && print_with_color)
{
printf("\e[2K");
}
}
void get_simplifications(void)