#!perl -w while(<>){ die unless /^depth\s+(\d+).*pv (\S+)/; $depth=$1; $firstmove=$2; if(not defined($old) or $depth != $old){ print"\n" if defined($old); printf('%2d',$depth); $old=$depth; } print " ",&getsan($firstmove); } sub getsan { my $move=shift; if (defined($sancache{$move})){ $sancache{$move} } else { #https://github.com/kenta2/uci-chess/tree/39a5a3be1b9112d5bed56cfca839c9b75500caa2/moves-to-fen.pl my $line = `perl moves-to-fen.pl --san e2e4 $move`; chomp$line; die unless $line =~ /^san e4 (\S+)$/; $sancache{$move}=$1; } }