Fix empty algebraic notation returned

This commit is contained in:
ekzyis 2024-10-16 03:34:48 +02:00
parent e414728965
commit 60b4739ac3
1 changed files with 4 additions and 0 deletions

View File

@ -240,6 +240,10 @@ func (b *Board) SetPiece(name PieceName, color Color, position string) error {
} }
func (b *Board) AlgebraicNotation() string { func (b *Board) AlgebraicNotation() string {
if len(b.Moves) == 0 {
return ""
}
var text string var text string
for i, m := range b.Moves { for i, m := range b.Moves {
if i%2 == 0 { if i%2 == 0 {