Back to task

385 symbols python3
Wed Jan 3 17:40:53 2018 Sait2000
def F(r,t,x):
 *p,=o=[' ']*len(r);n=1
 for s in S(S(I(),": ",1)[1],", "):
  e,b,*_=map(int,S(s,":")*2);s=slice(~e,-b or 99);d=e-b+1;p[s]=e>b and"/%s\\"%("-"*(d-2))or"^";o[~e]=str(n);n+=1
  if x:t+=r[s]
  else:r[s],t=t[:d],t[d:]
 return[''.join(q).rstrip()for q in(o,p,x*t or r)]
I=input
S=str.split
f,g=S(I())
*o,r=F(g,[],1)
t,u=S(I())
print(f,*o,g,"","="+r,"",t,*F([*u],r,0),sep='\n')


Leave a comment

Parsed as Markdown

Login to leave a comment