Skip to content

Commit cc2b8b7

Browse files
authored
docs: fix README.md for get all moves (#81)
1 parent 20cf758 commit cc2b8b7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,9 @@ fmt.Println(game.Position().Board().Draw())
657657
*/
658658
```
659659

660-
### Move History
660+
### Moves
661661

662-
Move History is a convenient API for accessing aligned positions, moves, and comments. Move
663-
History is useful when trying to understand detailed information about a game. Below is an
662+
Moves is a convenient API for accessing aligned positions, moves, and comments. Moves is useful when trying to understand detailed information about a game. Below is an
664663
example showing how to see which side castled first.
665664

666665
```go
@@ -685,9 +684,9 @@ func main() {
685684
}
686685
game := chess.NewGame(pgn)
687686
color := chess.NoColor
688-
for _, mh := range game.MoveHistory() {
689-
if mh.Move.HasTag(chess.KingSideCastle) || mh.Move.HasTag(chess.QueenSideCastle) {
690-
color = mh.PrePosition.Turn()
687+
for _, mh := range game.Moves() {
688+
if mh.HasTag(chess.KingSideCastle) || mh.HasTag(chess.QueenSideCastle) {
689+
color = mh.Position().Turn()
691690
break
692691
}
693692
}

0 commit comments

Comments
 (0)