X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=4459015e7c8510de4bf79044480c5e4b88ad4214;hp=7a498c6ac42c1b8954f6076ecbf20907e75fbee9;hb=2e6f47cc12a8ce6fdd3c8d5da5183abb8cc3719a;hpb=03b5cad6d724925cbb524c09965b9217d2b7601c diff --git a/remoteglot.pl b/remoteglot.pl index 7a498c6..4459015 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -184,10 +184,14 @@ sub handle_pgn { $pgn->quick_parse_game; my $pos = Position->start_pos($pgn->white, $pgn->black); my $moves = $pgn->moves; + my @uci_moves = (); for my $move (@$moves) { my ($from_row, $from_col, $to_row, $to_col, $promo) = $pos->parse_pretty_move($move); + push @uci_moves, Board::move_to_uci_notation($from_row, $from_col, $to_row, $to_col, $promo); $pos = $pos->make_move($from_row, $from_col, $to_row, $to_col, $promo); } + $pos->{'history'} = \@uci_moves; + $pos->{'pretty_history'} = $moves; handle_position($pos); }