From 1c213c5700be21248a7da7f8bed608cb3c2e80b5 Mon Sep 17 00:00:00 2001 From: Mahdi Mohammadi Date: Fri, 12 Dec 2025 14:24:17 +0330 Subject: [PATCH] docs: fix README.md for get all moves --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2e65eb6..15ad129 100644 --- a/README.md +++ b/README.md @@ -657,10 +657,9 @@ fmt.Println(game.Position().Board().Draw()) */ ``` -### Move History +### Moves -Move History is a convenient API for accessing aligned positions, moves, and comments. Move -History is useful when trying to understand detailed information about a game. Below is an +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 example showing how to see which side castled first. ```go @@ -685,9 +684,9 @@ func main() { } game := chess.NewGame(pgn) color := chess.NoColor - for _, mh := range game.MoveHistory() { - if mh.Move.HasTag(chess.KingSideCastle) || mh.Move.HasTag(chess.QueenSideCastle) { - color = mh.PrePosition.Turn() + for _, mh := range game.Moves() { + if mh.HasTag(chess.KingSideCastle) || mh.HasTag(chess.QueenSideCastle) { + color = mh.Position().Turn() break } }