Skip to main content
added 46 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 123 112 110 109 100 9898 96 bytes

i=n=input()
while i:a=i%2;print' '*(n-i)+'\%s/'%['_',((-~i/2)*'/   \  |'[a::2])[a:-1-a]][i>1];i~a]][i>1];i-=1

Try it online!Try it online!

Saved a bunch of bytes by using input and string formatting as in Rod's answer

  • Saved a bunch of bytes by using input and string formatting as in Rod's answer
  • Saved 2 bytes thanks to Mr. Xcoder

Python 2, 123 112 110 109 100 98 bytes

i=n=input()
while i:a=i%2;print' '*(n-i)+'\%s/'%['_',((-~i/2)*'/   \  |'[a::2])[a:-1-a]][i>1];i-=1

Try it online!

Saved a bunch of bytes by using input and string formatting as in Rod's answer

Python 2, 123 112 110 109 100 98 96 bytes

i=n=input()
while i:a=i%2;print' '*(n-i)+'\%s/'%['_',((-~i/2)*'/   \  |'[a::2])[a:~a]][i>1];i-=1

Try it online!

  • Saved a bunch of bytes by using input and string formatting as in Rod's answer
  • Saved 2 bytes thanks to Mr. Xcoder
added 2 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 123 112 110 109109 100 98 bytes

n=inputi=n=input()
forwhile i in range(n):a=a=i%2;print' '*(n-i)%2;print' '*i+'\\'+['_'+'\%s/'%['_',((~(n-i)~i/-2)*'/   \  |'[a::2])[a:-1-a]][i<na]][i>1];i-1]+'/'=1

Try it online!Try it online!

Saved a bunch of bytes by using input and string formatting as in Rod's answer

Python 2, 123 112 110 109 bytes

n=input()
for i in range(n):a=(n-i)%2;print' '*i+'\\'+['_',((~(n-i)/-2)*'/   \  |'[a::2])[a:-1-a]][i<n-1]+'/'

Try it online!

Python 2, 123 112 110 109 100 98 bytes

i=n=input()
while i:a=i%2;print' '*(n-i)+'\%s/'%['_',((-~i/2)*'/   \  |'[a::2])[a:-1-a]][i>1];i-=1

Try it online!

Saved a bunch of bytes by using input and string formatting as in Rod's answer

deleted 5 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 123 112 110110 109 bytes

def fn=input(n):
 for i in range(n):a=(n-i)%2;print' '*i+'\\'+['_',('(~(n-i)/-2)*'/   \  |'[a::2]*(a+(n-i)/2)2])[a:-1-a]][i<n-1]+'/'

Try it online!Try it online!

Python 2, 123 112 110 bytes

def f(n):
 for i in range(n):a=(n-i)%2;print' '*i+'\\'+['_',('/   \  |'[a::2]*(a+(n-i)/2))[a:-1-a]][i<n-1]+'/'

Try it online!

Python 2, 123 112 110 109 bytes

n=input()
for i in range(n):a=(n-i)%2;print' '*i+'\\'+['_',((~(n-i)/-2)*'/   \  |'[a::2])[a:-1-a]][i<n-1]+'/'

Try it online!

Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63
Loading