From 260c0217da4894edb753c7171d9aa2a3c65816df Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 8 Jul 2007 13:34:54 +0200 Subject: [PATCH] Say what move we're analyzing from. --- remoteglot.pl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/remoteglot.pl b/remoteglot.pl index 8c87108..b36487d 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -18,7 +18,7 @@ use warnings; # Configuration my $server = "freechess.org"; -my $target = "22"; +my $target = "224"; # my $engine = "/usr/games/toga2"; my $engine = "wine Rybkav2.3.2a.mp.w32.exe"; my $telltarget = undef; # undef to be silent @@ -374,6 +374,8 @@ sub style12_to_fen { $fen .= $x[26]; $pos{'fen'} = $fen; + $pos{'move_num'} = $x[26]; + $pos{'last_move'} = $x[29]; return \%pos; } @@ -566,12 +568,22 @@ sub output_screen { return; } - my $text = ''; + my $text = 'Analysis'; + if ($pos_calculating->{'last_move'} ne 'none') { + if ($pos_calculating->{'toplay'} eq 'W') { + $text .= sprintf ' after %u. ... %s', ($pos_calculating->{'move_num'}-1), $pos_calculating->{'last_move'}; + } else { + $text .= sprintf ' after %u. %s', $pos_calculating->{'move_num'}, $pos_calculating->{'last_move'}; + } + if (exists($uciid{'name'})) { + $text .= ','; + } + } if (exists($uciid{'name'})) { - $text .= "Analysis by $uciid{'name'}:\n\n"; + $text .= " by $uciid{'name'}:\n\n"; } else { - $text .= "Analysis:\n\n"; + $text .= ":\n\n"; } return unless (exists($pos_calculating->{'board'})); -- 2.39.2