Skip to content

Commit

Permalink
Merge pull request #85 from sumnerevans/encode-space-after-move-num
Browse files Browse the repository at this point in the history
pgn.encodePGN: add space between move number period and white's move
  • Loading branch information
notnil authored Dec 18, 2021
2 parents efbbef8 + 88a5f35 commit b6d4fbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions game_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ func TestSufficentMaterial(t *testing.T) {

func TestSerializationCycle(t *testing.T) {
g := NewGame()
g.MoveStr("e4")
g.MoveStr("e5")
pgn, err := PGN(strings.NewReader(g.String()))
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pgn.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func encodePGN(g *Game) string {
pos := g.positions[i]
txt := g.notation.Encode(pos, move)
if i%2 == 0 {
s += fmt.Sprintf("%d.%s", (i/2)+1, txt)
s += fmt.Sprintf("%d. %s", (i/2)+1, txt)
} else {
s += fmt.Sprintf(" %s ", txt)
}
Expand Down

0 comments on commit b6d4fbd

Please sign in to comment.