From c4ca9b016a0c2bfd4efa7c01602bf20b910b5860 Mon Sep 17 00:00:00 2001 From: Zander Thannhauser Date: Wed, 25 Jun 2025 21:15:06 -0500 Subject: [PATCH] added better repl message --- main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 28b9a56..f529545 100644 --- a/main.c +++ b/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(""); } } }