Reduce analysis randomness
[rattatechess.git] / epd / lp.pl
blob5cb0ca4659b3ed6bc988452a5886672bffda4d65
1 # scoring script for LAPUCE2 test
2 if (@ARGV) {
3 open(DATA,@ARGV[0]) || die "Can't open file " . $_;
4 $move = "";
5 $time = 0;
6 $total_score = 0;
7 $num_correct = 0;
8 while (<DATA>)
10 if (/^ply/)
12 split;
13 $newmove = @_[2];
14 $newtime = @_[3];
15 if ($newmove ne $move)
17 $move = $newmove;
18 $time = $newtime;
21 elsif (/^search:/)
23 if (/correct/)
25 $num_correct++;
26 # print "correct - time = " . $time . "\n";
27 $score = 0;
28 if ($time <= 9)
30 $score = 30;
32 elsif ($time <= 29)
34 $score = 25;
36 elsif ($time <= 89)
38 $score = 20;
40 elsif ($time <= 179)
42 $score = 15;
44 elsif ($time <= 389)
46 $score = 10;
48 else
50 $score = 5;
52 $total_score += $score;
54 $time = 0;
55 $move = "";
59 print $num_correct . " correct.\n";
60 # print "time = " . $total_time . "\n";
61 print "rating = " . (1900 + $total_score) . "\n";