football league standings by nn

s=[]
System.in.eachLine{i=G=W=D=F=A=0
it.eachMatch(/(.)-(.)/){a,b,c->F+=w=(int)b%48
A+=l=(int)c%48
W+=w>l?1:0
D+=w-l?0:1
G++}
P=3*W+D
s[6*P+F]=sprintf("%s${'%3d'*7}%${F-A?'+':''}4d\n",n=(it=~/\w+/)[0],G,P,W,D,G-W-D,F,A,F-A)}
printf"%${n.length()+4}sP Pt  W  D  L  F  A  GD\n",' '
(89..6).any{s[it]&&print(++i+' '+s[it])}

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

download

return to the top page