File: process-measure-output.pl

package info (click to toggle)
freecell-solver 3.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,864 kB
  • ctags: 3,658
  • sloc: ansic: 34,721; perl: 12,320; xml: 5,999; python: 1,149; sh: 965; ruby: 347; cpp: 304; makefile: 151
file content (29 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl

use strict;
use warnings;

my @depths;
my $depth;
my $depth_sum = 0;
my $depth_count = 0;
while (my $line = <ARGV>)
{
    chomp($line);
    if ($line =~ m{\ADepth == (\d+)\z})
    {
        my $new_depth = $1;
        if (defined($depth))
        {
            print "$depth " . ($depth_sum / $depth_count) . "\n";
            $depth_sum = $depth_count = 0;
        }
        $depth = $new_depth;
    }
    elsif ($line =~ m{\Aboard\[\d+\]\.iters == (\d+)\z})
    {
        $depth_count++;
        $depth_sum += $1;
    }
}
print "$depth " . ($depth_sum / $depth_count) . "\n";