Bracket Matching by murky-satyr

S=[]
System.in.eachLine{i=j=0
println it.any{++j
x=(int)it%87
e=x%4?(S[i--]^x)>2:!(S[++i]=x)}||i?'failed at: '+(e?it[j-1..-1]:'EOL'):'yes'}

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

download

return to the top page