3 # pattern_getdrops - Find significant value drops in kgslog GTP stream
4 # and convert them to lead-in game records for pattern learning
7 # tools/kgslog2gtp.pl | tools/pattern_getdrops.pl | tools/pattern_bayes_gen.sh -
10 use vars
qw(@game $lastval $valthres $valfrac);
18 if ($_[0] eq 'pachi-mygame') {
20 print STDERR "*** new game [@game]\n";
24 } elsif ($_[0] eq 'pachi-mymove') {
25 if ($lastval > 0 and $lastval < $valthres and $_[2] / $lastval < $valfrac) {
26 print STDERR "large value drop $lastval -> $_[2] [@game :: @_]\n";
27 print "$_\n" for @commands;
28 print "play $game[0] $_[1] 1\n";
31 my $cmd = "play $game[0] $_[1] 0 $_[2]";
34 } elsif ($_[0] eq 'play') {