X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=Position.pm;fp=Position.pm;h=8a42a6fa39f59f9e42bd80ec08bb5d7719a759e7;hp=6976c96b68958880b0c58932a58cae0bedd92a14;hb=bdf7fb246fa3fcf64350d8edd3f3a9ea9c32f46f;hpb=01a8eaa3db2c015b25c0cf53df96b12493f3db58 diff --git a/Position.pm b/Position.pm index 6976c96..8a42a6f 100644 --- a/Position.pm +++ b/Position.pm @@ -221,6 +221,9 @@ sub make_move { if (exists($pos->{'start_fen'})) { $np->{'start_fen'} = $pos->{'start_fen'}; } + if (exists($pos->{'chess960'})) { + $np->{'chess960'} = $pos->{'chess960'}; + } if (defined($pretty_move)) { $np->{'last_move'} = $pretty_move; } else { @@ -242,6 +245,11 @@ sub make_pretty_move { return ($pos, $uci_move); } +sub is_chess960 { + my ($pos) = shift; + return (defined($pos->{'chess960'}) && $pos->{'chess960'}); +} + sub _pos_to_square { my ($row, $col) = @_; return sprintf("%c%d", ord('a') + $col, 8 - $row);