Thông tin
Brainf**k compiler
s=input()
a=[0]*30000
ptr=0
code=0
err=False
while code<len(s):
x=s[code]
if x==".":
print(chr(a[ptr]),end="")
elif x=="<":
ptr-=1
if ptr<0:
err=True
elif x==">":
ptr+=1
if ptr>=30000:
err=True
elif x=="+":
a[ptr]+=1
a[ptr]%=256
elif x=="-":
a[ptr]-=1
a[ptr]%=256
elif x==",":
y=input()
a[ptr]=ord(y[0])
elif x=="[":
if a[ptr]==0:
st=["["]
while len(st)>0:
code+=1
if code>=len(s):
err=True
break
if s[code]=="[" or s[code]=="]":
st.append(s[code])
if st[-2]=="[" and st[-1]=="]":
st.pop();st.pop()
elif x=="]":
if a[ptr]!=0:
st=["]"]
while len(st)>0:
code-=1
if code<0:
err=True
break
if s[code]=="[" or s[code]=="]":
st.append(s[code])
if st[-2]=="]" and st[-1]=="[":
st.pop();st.pop()
if err:
print("Error!")
break
code+=1
Huy hiệu
Người dùng này không có huy hiệu nào.