fixed
This commit is contained in:
parent
73aa9f8854
commit
ec2a384482
4
board.go
4
board.go
|
|
@ -69,7 +69,7 @@ func (b *Board) inBounds(r, c int) bool {
|
|||
|
||||
func (b *Board) isSquareAttacked(pos Position, byColor int) bool {
|
||||
r, c := pos.Row, pos.Col
|
||||
pawnDir := 1
|
||||
pawnDir := -1
|
||||
if byColor == Black {
|
||||
pawnDir = 1
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ var diagDirs = [][2]int{{-1, -1}, {-1, 1}, {1, -1}, {1, 1}}
|
|||
func (b *Board) pawnMoves(from Position, color int) []Move {
|
||||
var moves []Move
|
||||
r, c := from.Row, from.Col
|
||||
dir := 1
|
||||
dir := -1
|
||||
if color == Black {
|
||||
dir = 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue