Closed LouieMartin closed 4 months ago
My solution to looping through all the pieces was to use the 'SquareMap'. According to the documentation: "SquareMap returns a mapping of squares to pieces. A square is only added to the map if it is occupied."
squareMap := game.Position().Board().SquareMap()
for square, piece := range squareMap {
// logic
}
I was looking on how to loop for all the pieces like: