From anonymous, 3 Weeks ago, written in Python.
Embed
  1. import itertools
  2.  
  3. charset = '01345HLXcdfr'
  4. numbers = [ord(c) for c in charset]
  5.  
  6. while True:
  7.     cond = input('condition? ')
  8.     print()
  9.     if 'z' in cond:
  10.         pairs = itertools.product(numbers, numbers, numbers)
  11.         for x, y, z in pairs:
  12.             if eval(cond):
  13.                 print(f"x = {x} = '{chr(x)}'")
  14.                 print(f"y = {y} = '{chr(y)}'")
  15.                 print(f"z = {z} = '{chr(z)}'")
  16.                 print()
  17.     else:
  18.         pairs = itertools.product(numbers, numbers)
  19.         for x, y in pairs:
  20.             if eval(cond):
  21.                 print(f"x = {x} = '{chr(x)}'")
  22.                 print(f"y = {y} = '{chr(y)}'")
  23.                 print()
  24.