- or download this
foreach (sort { $player{$b}[1]*1 + $player{$b}[3]*.5 <=> $player{$a}[1
+]*1 + $player{$a}[3]*.5 } keys %player) {
print $_ . " " . join(" ", @{$player{$_}}[1..3]) . "\n";
}
- or download this
this results in
Kasparov 2 1 2
...
Anand 1 2 0
Shirov 1 1 0
Karpov 1 0 0
- or download this
$player{$1} = [ $1, $p1wins, $p1loss, $p1draw ];