better repl message
This commit is contained in:
parent
9b87f251d3
commit
dc8e79a9fa
1 changed files with 15 additions and 7 deletions
22
main.py
22
main.py
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue