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

Python 2, 79 78 7373 72 bytes

n,d=input()
c='|\/'[d]
i=n
while i:print' '*(n-i*d)+c,['i%2*c or' ',c][i%2],c;i-=1

Try it online!Try it online!

Takes [1,0,-1] for [north-west, north, north-east]

-1 byte, thanks to Neil

Python 2, 79 78 73 bytes

n,d=input()
c='|\/'[d]
i=n
while i:print' '*(n-i*d)+c,[' ',c][i%2],c;i-=1

Try it online!

Takes [1,0,-1] for [north-west, north, north-east]

Python 2, 79 78 73 72 bytes

n,d=input()
c='|\/'[d]
i=n
while i:print' '*(n-i*d)+c,i%2*c or' ',c;i-=1

Try it online!

Takes [1,0,-1] for [north-west, north, north-east]

-1 byte, thanks to Neil

added 17 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 79 7878 73 bytes

n,d=input()
c='|\/'[d]
fori=n
while i in range(n):print' '*(n+i*dn-i*d)+c,[' ',c][(n-i)%2]c][i%2],cc;i-=1

Try it online!Try it online!

Takes d as [1,0,-1] for left[north-west,center north,right north-east]

Python 2, 79 78 bytes

n,d=input()
c='|\/'[d]
for i in range(n):print' '*(n+i*d)+c,[' ',c][(n-i)%2],c

Try it online!

Takes d as [1,0,-1] for left,center,right

Python 2, 79 78 73 bytes

n,d=input()
c='|\/'[d]
i=n
while i:print' '*(n-i*d)+c,[' ',c][i%2],c;i-=1

Try it online!

Takes [1,0,-1] for [north-west, north, north-east]

added 58 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 7979 78 bytes

n,d=input()
c='|c='|\/\\'[d]'[d]
for i in range(n):print' '*(n-i*dn+i*d)+c,[' ',c][(n-i)%2],c

Try it online!Try it online!

Takes d as [1,0,-1] for left,center,right

Python 2, 79 bytes

n,d=input()
c='|/\\'[d]
for i in range(n):print' '*(n-i*d)+c,[' ',c][(n-i)%2],c

Try it online!

Python 2, 79 78 bytes

n,d=input()
c='|\/'[d]
for i in range(n):print' '*(n+i*d)+c,[' ',c][(n-i)%2],c

Try it online!

Takes d as [1,0,-1] for left,center,right

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