mirror of
https://github.com/MSWS/Chess.git
synced 2025-12-05 21:30:23 -08:00
- Enhance `testdata/integration_test.go` with improved logging and subtest naming for better clarity. - Refine castle move legality checks in `board/move.go` to ensure accurate column-based validation. [testdata/integration_test.go] - Updated log statement in `testData` function to include both the description and FEN string. - Modified subtest naming to replace slashes in the FEN string with periods. [board/move.go] - Adjusted conditional logic for castle-related moves to check for different column coordinates when determining legality. - No functional changes outside of castle move handling.
29 lines
453 B
Go
29 lines
453 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/msws/chess/board"
|
|
)
|
|
|
|
func main() {
|
|
board, err := board.FromFEN("8/8/4k3/8/8/8/4p3/R3K2R w KQ - 0 1")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
baseMoves := board.GetMoves()
|
|
|
|
for _, move := range baseMoves {
|
|
board.MakeMove(move)
|
|
|
|
newMoves := board.GetMoves()
|
|
fmt.Printf("%v: %d moves\n", move, len(newMoves))
|
|
fmt.Println(newMoves)
|
|
|
|
board.UndoMove()
|
|
}
|
|
|
|
fmt.Printf("(%d) %v", len(baseMoves), baseMoves)
|
|
}
|