Skip to main content
added 411 characters in body
Source Link
loopy walt
  • 16.8k
  • 2
  • 11
  • 69

Python, 7473 bytes (@DialFrost@ovs)

f=lambda n,m=0,p=-1:n*[n]and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))

Attempt This Online!

Old Python, 74 bytes (@DialFrost)

f=lambda n,m=0,p=-1:n and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

Attempt This Online!

Old Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Python, 74 bytes (@DialFrost)

f=lambda n,m=0,p=-1:n and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

Attempt This Online!

Old Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Python, 73 bytes (@ovs)

f=lambda n,m=0,p=-1:n*[n]and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))

Attempt This Online!

Old Python, 74 bytes (@DialFrost)

f=lambda n,m=0,p=-1:n and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

Attempt This Online!

Old Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

added 421 characters in body
Source Link
loopy walt
  • 16.8k
  • 2
  • 11
  • 69

Python, 7674 bytes (@DialFrost)

f=lambda n,m=0,p=-1:n and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

Attempt This Online!

Old Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Python, 74 bytes (@DialFrost)

f=lambda n,m=0,p=-1:n and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

Attempt This Online!

Old Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

added 458 characters in body
Source Link
loopy walt
  • 16.8k
  • 2
  • 11
  • 69

Python, 9176 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Python, 76 bytes

f=lambda n,m=0,p=-1:n>m and((*range(m,n),),*zip(*f(2*n-m+p,n,~p)[::-1]))or()

-15 by reversing order of recursion.

Attempt This Online!

Old Python, 91 bytes

lambda n:g((n*n-1,))
g=lambda*s:(l:=s[0][0])and g((*range(l-len(s),l),),*zip(*s[::-1]))or s

Attempt This Online!

Builds the spiral from inside to out by recursively rotating 90° and adding a row on the top.

Source Link
loopy walt
  • 16.8k
  • 2
  • 11
  • 69
Loading