box in box by croyal

def d(m,n,a,l):
 for i in range(l):
  for j in range(l):
   if i==0 or j==0 or i==l-1 or j==l-1:a[m+i][n+j]='[]'
x=0
b=[]
for i in range(41):
 r=[]
 for j in range(41):
  r+=['  ']
 b+=[r]
for p in range(4,0,-1):
 for y in range(p+1):
  for z in range(p+1):
   if y==0 or z==0 or y==p or z==p:
    d(x+2*p*y,x+2*p*z,b,2*p+1)
 x+=2*p
for y in b:print''.join(y)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page