From 3fd43cd5fcb22bb65bf2a92a25d95d801b11c9e0 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Wed, 1 Jun 2016 18:58:58 -0700 Subject: Initial checkin for typhoon chess engine. --- src/layout_parse.pl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 src/layout_parse.pl (limited to 'src/layout_parse.pl') diff --git a/src/layout_parse.pl b/src/layout_parse.pl new file mode 100755 index 0000000..f0d055a --- /dev/null +++ b/src/layout_parse.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl + +opendir(DIR, ".") || die; +@files = readdir(DIR); +closedir(DIR); + +$max = 0; +$maxpos = -1; +$sum = 0; +$min = 99999999; +$minpos = -1; +$count = 0; + +for $file(@files) +{ + if ($file =~ /(\d+)typhoon\.log/) + { + $num = $1; + open(FILE, $file); + while() + { + if (/\((\d+) nps\)\./) + { + $count++; + $speed = $1; + $sum += $speed; + if ($speed > $max) + { + $maxpos = $num; + $max = $speed; + } + if ($speed < $min) + { + $minpos = $num; + $min = $speed; + } + } + } + close(FILE); + } +} + +printf "max $max at $maxpos, min $min at $minpos, avg %f\n", ($sum/$count); -- cgit v1.3