better repl message

This commit is contained in:
Zander Thannhauser 2025-06-04 15:56:03 -05:00
parent 9b87f251d3
commit dc8e79a9fa

22
main.py
View file

@ -397,12 +397,16 @@ def evaluate(expr):
def repl(args, cost, lookup):
import readline;
print("""
Give a boolean expression using the variables 'w', 'x', 'y' and 'z'.
Operations: not ('!'), or ('||'), and ('&&').
Extended operations: nor ('!|'), orn ('|!'), nand ('!&'), andn ('&!'), xor ('!='),
Extended operations: nxor ('==')
""");
print("Give a boolean expression using the variables 'w', 'x', 'y' and 'z'.");
print("Operations: not ('!'), or ('||'), and ('&&').""");
print();
if args.extended_operators:
print("Extended operations: nor ('!|'), orn ('|!'), nand ('!&'), ");
print("andn ('&!'), xor ('!='), and nxor ('==')");
print();
# print(f'I can do anything in {max(cost.values())} operations.')
# print();
@ -414,7 +418,11 @@ Extended operations: nxor ('==')
line = input(">>> ");
except EOFError:
return;
line = line.strip();
if not line: continue;
truthtable = evaluate(parse(parser, line));
if truthtable in lookup: