Skip to main content
2 of 4
-20 bytes.
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release), 263 243 bytes

-20 bytes by applying some small modifications.

Darn, didn't get first…

def f(b): l=len(b:=[j for i in b for j in i and[i]or[0,2]]);S=[[" "]*-~l for i in range(l+1)] for i in range(l):S[i][l+~i]=S[i+1][l-i]="\\" for i in range(l-1):S[l-2-i][i]=S[l-i][i+2]=" "if b[i]else"/" return"\n".join("".join(i)for i in S) 

Takes input like f([1, 0, 1, 1, 0, 1, 0, 0]).

Try it online!

squareroot12621
  • 1.2k
  • 1
  • 3
  • 18