Turing Machine by kotauchi

t=["0"]*999\x0d
s=raw_input().replace(" ","")\x0d
p=[]\x0d
while 1:\x0d
    try:p=p+raw_input().replace(": ","").split(" ")[1:]\x0d
    except:break\x0d
x=0\x0d
i=a=b=499\x0d
while 1:\x0d
 v=p[x+int(t[i])*len(s)]\x0d
 t[i]=v[0]\x0d
 if v[2]!="#":x=s.index(v[2])\x0d
 else:print "".join(t[a:b+1]);break\x0d
 if(v[1]=="<"):i-=1;a=min(i,a)\x0d
 else:i+=1;b=max(i,b)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page