Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

3 of 6
deleted 26 characters in body
Chas Brown
  • 9.8k
  • 1
  • 14
  • 39

Python 2, 158 bytes

n,d=input()
r=[1]
exec"print''.join('.-~+*#@$'[[i for i in range(8)if c%d**i<1][-1]]*2for c in r).center(2*n);r=[1]+[a+b for a,b in zip(r[:-1],r[1:])]+[1];"*n

Try it online!

Uses .-~+*#@$ as the 8 characters instead of 8 colors.

Chas Brown
  • 9.8k
  • 1
  • 14
  • 39

AltStyle によって変換されたページ (->オリジナル) /