added better repl message
This commit is contained in:
parent
f528eaeb83
commit
c4ca9b016a
1 changed files with 14 additions and 1 deletions
15
main.c
15
main.c
|
|
@ -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("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue