]> git.sesse.net Git - remoteglot/blobdiff - remoteglot.pl
Fix some deep recursion.
[remoteglot] / 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 {