football league standings by nn

G=gsub("-",W=D=F=A=FS){for(;_$2;D+=w~l){A+=l=$NF
F+=w=$--NF
--NF
W+=w>l}$7=OFS="%3d"
a[(P=3*W+D)F]=sprintf($0"%"(F-A?"+":_)"4d",G,P,W,D,G-W-D,F,A,F-A)}END{printf"%"length-17"sP Pt  W  D  L  F  A  GD\n",_
for(i=2e3;i--;)if(v=a[i])print++k" "v}

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

download

return to the top page