postfix to infix by shinh

#!ruby -p
a=[]
gsub(/./){|s|d=a<<(s[/\w/]||2.times{|i|B=d
d=a.pop
d[1]&&s[0]*4%19-i>d[1][0]*8%13/5*8&&d="(#{d})"}&&[d,s,B])
''}
$><<a

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

download

return top