Farz0l1x

Untitled

Dec 7th, 2023
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. from itertools import *
  2. def f(x, y, z, w):
  3.     return (x and not(y)) or (x == z) or w
  4. for a in product([0,1], repeat = 4):
  5.     table = [(1, a[0], 0, 0), (1, 1, a[1], 0), (a[2], 1, 1, a[3])]
  6.     if len(table) == len(set(table)):
  7.         for p in permutations('xyzw'):
  8.             if [f(**dict(zip(p, r))) for r in table] == [0, 0, 0]:
  9.                 print(p)
  10.    
Advertisement
Add Comment
Please, Sign In to add comment