added better repl message

This commit is contained in:
Zander Thannhauser 2025-06-25 21:15:06 -05:00
parent f528eaeb83
commit c4ca9b016a

15
main.c
View file

@ -1457,6 +1457,7 @@ int main(int argc, char* const* argv)
else
{
// Let's humble-brag just a little.
#if 0
{
int max_cost = 0;
@ -1475,9 +1476,20 @@ int main(int argc, char* const* argv)
max_cost);
puts("");
}
#endif
if (!quiet)
{
puts("Use C-style syntax for boolean operators and expressions.");
puts("Available variables: 'w', 'x', 'y' and 'z'.");
puts("Extended operators: nor is '!|', orn is '|!', nand is '!&', andn is '&!'.");
}
for (char* line; (line = readline(">>> ")); free(line))
{
if (!*line) continue;
add_history(line);
uint16_t truthtable = evaluate(line);
@ -1490,7 +1502,8 @@ int main(int argc, char* const* argv)
}
else
{
printf("%2i: ", lookup[truthtable].cost), print(truthtable, 0), puts("");
printf("%2i: ", lookup[truthtable].cost),
print(truthtable, 0), puts("");
}
}
}