Fixes to pluto heuristic, small cleanups.
[rattatechess.git] / epd / bt.pl
blobc86f60e81f7169e9aae90a99745e35fd860fa355
1 if (@ARGV) {
2 open(DATA,@ARGV[0]) || die "Can't open file " . $_;
3 $move = "";
4 $time = 0;
5 $total_time = 0;
6 $num_correct = 0;
7 while (<DATA>)
9 if (/^ply/)
11 split;
12 $newmove = @_[2];
13 $newtime = @_[3];
14 if ($newmove ne $move)
16 $move = $newmove;
17 $time = $newtime;
20 elsif (/^search:/)
22 if (/correct/)
24 $num_correct++;
25 # print "correct - time = " . $time . "\n";
26 $total_time += $time;
27 $time = 0;
28 $move = "";
32 print $num_correct . " correct.\n";
33 #print "time = " . $total_time . "\n";
34 print "rating = " . (2630 - ((900*(30-$num_correct)) + $total_time)/30) . "\n";