Skip to main content
Commonmark migration
Source Link

#Python 3, 248 bytes def f(a,b): l=[['(',')','[','<',1],['[',']',']','<=',0]] r=[0,1] for i in r: for j in r: print(('%s%d,%d%s='*2+'{%d%sx%s%d}={%d%sx&&x%s%d}=%d..%d')%((l[j][0],a,b,l[i][1],l[1-j][2],a,b,l[i][2])+(a,l[j][3],l[i][3],b)*2+(a+l[j][4],b-l[i][4])))

Python 3, 248 bytes

def f(a,b):
 l=[['(',')','[','<',1],['[',']',']','<=',0]]
 r=[0,1]
 for i in r:
  for j in r:
   print(('%s%d,%d%s='*2+'{%d%sx%s%d}={%d%sx&&x%s%d}=%d..%d')%((l[j][0],a,b,l[i][1],l[1-j][2],a,b,l[i][2])+(a,l[j][3],l[i][3],b)*2+(a+l[j][4],b-l[i][4])))

Try it online!

#Python 3, 248 bytes def f(a,b): l=[['(',')','[','<',1],['[',']',']','<=',0]] r=[0,1] for i in r: for j in r: print(('%s%d,%d%s='*2+'{%d%sx%s%d}={%d%sx&&x%s%d}=%d..%d')%((l[j][0],a,b,l[i][1],l[1-j][2],a,b,l[i][2])+(a,l[j][3],l[i][3],b)*2+(a+l[j][4],b-l[i][4])))

Try it online!

Python 3, 248 bytes

def f(a,b):
 l=[['(',')','[','<',1],['[',']',']','<=',0]]
 r=[0,1]
 for i in r:
  for j in r:
   print(('%s%d,%d%s='*2+'{%d%sx%s%d}={%d%sx&&x%s%d}=%d..%d')%((l[j][0],a,b,l[i][1],l[1-j][2],a,b,l[i][2])+(a,l[j][3],l[i][3],b)*2+(a+l[j][4],b-l[i][4])))

Try it online!

Source Link

#Python 3, 248 bytes def f(a,b): l=[['(',')','[','<',1],['[',']',']','<=',0]] r=[0,1] for i in r: for j in r: print(('%s%d,%d%s='*2+'{%d%sx%s%d}={%d%sx&&x%s%d}=%d..%d')%((l[j][0],a,b,l[i][1],l[1-j][2],a,b,l[i][2])+(a,l[j][3],l[i][3],b)*2+(a+l[j][4],b-l[i][4])))

Try it online!