football league standings by dcutter

sub d{$d{$t}[pop]+=pop}while(<>){($t,@r)=split/ /;$d{$t}[0]=@r;for(@r){($x,$y)=split/-/;d(3,1),d(1,2)if$x>$y;d(1,1),d(1,3)if$x==$y;d($x<$y,4);d($x,5);d($y,6);d($x-$y,7)}}print' 'x(4+length$t)."P Pt  W  D  L  F  A  GD
";printf"%d %s"."%3d"x7 ."%4s
",++$i,$_,@{$d{$_}}[0..6],0<($/=${$d{$_}}[7])?"+$/":$/for sort{$d{$b}[1]<=>$d{$a}[1]||$d{$b}[7]<=>$d{$a}[7]||$d{$b}[5]<=>$d{$a}[5]}keys%d

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

download

return to the top page