diff --git a/board/move.go b/board/move.go index 81702d9..14ac2cd 100644 --- a/board/move.go +++ b/board/move.go @@ -118,7 +118,7 @@ func (game Game) GetMoves() []Move { if targetRow != enemyRow { continue } - if targetCol == 0 && enemyCol == 2 { + if targetCol == 0 && enemyCol == 3 { legal = false break } diff --git a/main.go b/main.go index 99e6bf7..266b1f8 100644 --- a/main.go +++ b/main.go @@ -1,22 +1,28 @@ package main +import ( + "fmt" + + "github.com/msws/chess/board" +) + func main() { - // board, err := board.FromFEN("8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - - 0 1") - // if err != nil { - // panic(err) - // } + board, err := board.FromFEN("8/8/4k3/8/8/8/4p3/R3K2R w KQ - 0 1") + if err != nil { + panic(err) + } - // baseMoves := board.GetMoves() + baseMoves := board.GetMoves() - // for _, move := range baseMoves { - // board.MakeMove(move) + for _, move := range baseMoves { + board.MakeMove(move) - // newMoves := board.GetMoves() - // fmt.Printf("%v: %d moves\n", move, len(newMoves)) - // fmt.Println(newMoves) + newMoves := board.GetMoves() + fmt.Printf("%v: %d moves\n", move, len(newMoves)) + fmt.Println(newMoves) - // board.UndoMove() - // } + board.UndoMove() + } - // fmt.Printf("(%d) %v", len(baseMoves), baseMoves) + fmt.Printf("(%d) %v", len(baseMoves), baseMoves) } diff --git a/testdata/integration_test.go b/testdata/integration_test.go index 24d6291..8e810d4 100644 --- a/testdata/integration_test.go +++ b/testdata/integration_test.go @@ -66,7 +66,7 @@ func testJson(t *testing.T, bytes []byte) { func testData(t *testing.T, data TestData) { for _, test := range data.Tests { - t.Log(test.Start.Description) + t.Log(test.Start.Description, test.Start.Fen) t.Run(strings.ReplaceAll(test.Start.Fen, "/", "."), func(t *testing.T) { testCase(t, test.Start, test.Expected) })