]> git.sesse.net Git - remoteglot/commitdiff
Fix some deep recursion.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 28 Oct 2019 20:20:04 +0000 (21:20 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 28 Oct 2019 20:20:04 +0000 (21:20 +0100)
remoteglot.pl

index d8a7925c9137cfe548b0b9729a98f8daf3defac7..9d611c0e6cfe2700cc0f8a5118f36b2e318b72fa 100755 (executable)
@@ -535,10 +535,14 @@ sub prettyprint_pv_no_cache {
                return ();
        }
 
-       my $pv = shift @pvs;
-       my ($from_row, $from_col, $to_row, $to_col, $promo) = parse_uci_move($pv);
-       my ($pretty, $nb) = $board->prettyprint_move($from_row, $from_col, $to_row, $to_col, $promo);
-       return ( $pretty, prettyprint_pv_no_cache($nb, @pvs) );
+       my @ret = ();
+       for my $pv (@pvs) {
+               my ($from_row, $from_col, $to_row, $to_col, $promo) = parse_uci_move($pv);
+               my ($pretty, $nb) = $board->prettyprint_move($from_row, $from_col, $to_row, $to_col, $promo);
+               push @ret, $pretty;
+               $board = $nb;
+       }
+       return @ret;
 }
 
 sub prettyprint_pv {