Skip to main content
added 23 characters in body
Source Link
Seb
  • 321
  • 2
  • 6

Python 3.8 (pre-release), 109111 100 bytes

lambdaf=lambda n,b=['*'],p=1:p>2 and b or f(n,[('[f'{2*r*l+l:^%d}'%^{(2*n-1)**p).format(2*r*l+l)for}}'for r in range(n)for l in b],p+1)

Try it online!Try it online!

Nowhere near the best Python 3 answers, but it's got recursion. See my answer on the source SO question for an ungolfed version with the same mechanisms.

-11 bytes thanks to @ovs

Python 3.8 (pre-release), 109 bytes

lambda n,b=['*'],p=1:p>2 and b or f(n,[('{:^%d}'%(2*n-1)**p).format(2*r*l+l)for r in range(n)for l in b],p+1)

Try it online!

Nowhere near the best Python 3 answers, but it's got recursion. See my answer on the source SO question for an ungolfed version with the same mechanisms.

Python 3.8 (pre-release), 111 100 bytes

f=lambda n,b=['*'],p=1:p>2 and b or f(n,[f'{2*r*l+l:^{(2*n-1)**p}}'for r in range(n)for l in b],p+1)

Try it online!

Nowhere near the best Python 3 answers, but it's got recursion. See my answer on the source SO question for an ungolfed version with the same mechanisms.

-11 bytes thanks to @ovs

Source Link
Seb
  • 321
  • 2
  • 6

Python 3.8 (pre-release), 109 bytes

lambda n,b=['*'],p=1:p>2 and b or f(n,[('{:^%d}'%(2*n-1)**p).format(2*r*l+l)for r in range(n)for l in b],p+1)

Try it online!

Nowhere near the best Python 3 answers, but it's got recursion. See my answer on the source SO question for an ungolfed version with the same mechanisms.