Skip to content

Instantly share code, notes, and snippets.

@Steffan153
Created May 11, 2026 23:05
Show Gist options
  • Select an option

  • Save Steffan153/230d75741f90904b43ecf25a5d7dd904 to your computer and use it in GitHub Desktop.

Select an option

Save Steffan153/230d75741f90904b43ecf25a5d7dd904 to your computer and use it in GitHub Desktop.
W=32
def f(x, y, w):
if w==2 and x==0:
return '┌│'[y]
if x >= w//2:
return f(w-1-x, y, w).translate(str.maketrans('┐┘┌└│', '┌└─┘└' if w!=W and y==w-1 else '┌└┐┘│'))
if y>=w//2:
if y>=w*3//4:
return f(x, w+w//2-y-1, w).translate(str.maketrans('┌┐└┘', '└┘┌┐'))
if x>=w//4:
return f(x+w//4,w-1-y, w).translate(str.maketrans('┌┐└┘', '└┘┌┐'))
else:
return f(x,w-1-y-w//4, w).translate(str.maketrans('┌┐└┘', '└┘┌┐'))
return f(x, y, w//2)
for y in range(W):
for x in range(W):
q=y==W-1 and x%~-W==0 and '╵' or f(x, y, W)
print(q, end=q in '┌└─' and '─' or' ')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment