When trying to call ismovecheck() during a tree search I stumbled across the error
LoadError: MethodError: no method matching bishoplike(::PieceColor)
[0mClosest candidates are:
[0m bishoplike([91m::Board[39m) at /home/fabio/.julia/packages/Chess/86E71/src/board.jl:600
[0m bishoplike([91m::Board[39m, [91m::PieceColor[39m) at /home/fabio/.julia/packages/Chess/86E71/src/board.jl:625
MethodError: no method matching bishoplike(::PieceColor)
Closest candidates are:
bishoplike(::Board) at /home/fabio/.julia/packages/Chess/86E71/src/board.jl:600
bishoplike(::Board, ::PieceColor) at /home/fabio/.julia/packages/Chess/86E71/src/board.jl:625
The functions bishoplike() and rooklike() take indeed a board and a color as argument but only a color is passed.
# src/board.jl:1263
# En passant checks
if moveisep(b, m)
capsq = Square(file(t), rank(f))
newocc = occ - f + t - capsq
if !isempty(bishopattacks(newocc, ksq) ∩ bishoplike(us))
return true
end
if !isempty(rookattacks(newocc, ksq) ∩ rooklike(us))
return true
end
end
I just added the board to the functions args and now it seems to work fine
# En passant checks
if moveisep(b, m)
capsq = Square(file(t), rank(f))
newocc = occ - f + t - capsq
if !isempty(bishopattacks(newocc, ksq) ∩ bishoplike(b, us))
return true
end
if !isempty(rookattacks(newocc, ksq) ∩ rooklike(b, us))
return true
end
end
When trying to call ismovecheck() during a tree search I stumbled across the error
The functions bishoplike() and rooklike() take indeed a board and a color as argument but only a color is passed.
I just added the board to the functions args and now it seems to work fine