Skip to main content
Forgot to change the byte count in the header
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release),  263   243   229   226   225   187   168  151 151  150 bytes

-20 bytes by applying some small modifications.
-14 bytes by emanresu A.
-3 bytes by noodle person.
-75 bytes by ASCII-only.
-1 byte by noodle person.

…Okay, what—

def f(b,c=[]): for i in b:c+=[[0c+=[0,2]1,[1]][i]2][i::2] for i in range(l:=len(c),-1,-1):print(" "*i+" /"[[0,*c][i]]+" \\"[i>0]+" \\"*(i<l)+" /"[[*c,0,0][i+1]]) 

Takes input like f([1, 0, 1, 1, 0, 1, 0, 0]).
Prints the output and returns None.

Try it online!Try it online!

Python 3.8 (pre-release),  263   243   229   226   225   187   168  151 bytes

-20 bytes by applying some small modifications.
-14 bytes by emanresu A.
-3 bytes by noodle person.
-75 bytes by ASCII-only.

…Okay, what—

def f(b,c=[]): for i in b:c+=[[0,2],[1]][i] for i in range(l:=len(c),-1,-1):print(" "*i+" /"[[0,*c][i]]+" \\"[i>0]+" \\"*(i<l)+" /"[[*c,0,0][i+1]]) 

Takes input like f([1, 0, 1, 1, 0, 1, 0, 0]).
Prints the output and returns None.

Try it online!

Python 3.8 (pre-release),  263   243   229   226   225   187   168   151  150 bytes

-20 bytes by applying some small modifications.
-14 bytes by emanresu A.
-3 bytes by noodle person.
-75 bytes by ASCII-only.
-1 byte by noodle person.

…Okay, what—

def f(b,c=[]): for i in b:c+=[0,1,2][i::2] for i in range(l:=len(c),-1,-1):print(" "*i+" /"[[0,*c][i]]+" \\"[i>0]+" \\"*(i<l)+" /"[[*c,0,0][i+1]]) 

Try it online!

-92 bytes by emanresu A, noodle person, and ASCII-only.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release),   263   243 243   229   226   225   187   168  151 bytes

-20 bytes by applying some small modifications.
-14 bytes by emanresu A.
-3 bytes by noodle person.
-75 bytes by ASCII-only.

Darn…Okay, didn't get first…what—

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

Takes input like f([1, 0, 1, 1, 0, 1, 0, 0]).
Prints the output and returns None.

Try it online!Try it online!

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!

Python 3.8 (pre-release),   263    243   229   226   225   187   168  151 bytes

-20 bytes by applying some small modifications.
-14 bytes by emanresu A.
-3 bytes by noodle person.
-75 bytes by ASCII-only.

…Okay, what—

def f(b,c=[]): for i in b:c+=[[0,2],[1]][i] for i in range(l:=len(c),-1,-1):print(" "*i+"  /"[[0,*c][i]]+" \\"[i>0]+" \\"*(i<l)+" /"[[*c,0,0][i+1]]) 

Takes input like f([1, 0, 1, 1, 0, 1, 0, 0]).
Prints the output and returns None.

Try it online!

-20 bytes.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release), 263263 243 bytes

-20 bytes by applying some small modifications.

Darn, didn't get first…

def f(b): l=2*lenl=len(b)-sum(:=[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]="\\" b="".join([str(i)for i in b]).replace("0","02") for i in range(l-1):S[l-2-i][i]=S[l-i][i+2]=" "if"0"<b[i]else""if b[i]else"/" return"\n".join("".join(i)for i in S) 

Try it online! Takes input like f([1, 0, 1, 1, 0, 1, 0, 0]).

Try it online!

Python 3.8 (pre-release), 263 bytes

Darn, didn't get first…

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

Try it online!

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!

Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18
Loading