romstad / Chess.jl

Julia chess programming library.
https://romstad.github.io/Chess.jl/dev/
Other
105 stars 18 forks source link

No threefold repetion draw #33

Closed dave7895 closed 2 years ago

dave7895 commented 2 years ago

Is it on purpose that the isdraw(g::Game) doesn't look if it's a draw by threefold repetition, but only for material and fifty move rule?

romstad commented 2 years ago

I'm not sure I understand the question correctly, but it does check for repetition draws. The function definition looks like this:

function isdraw(g::Game)::Bool
    isdraw(board(g)) || isrepetitiondraw(g)
end

The isrepetitiondraw(g) part checks for a draw by repetition

dave7895 commented 2 years ago

That's good, but somewhat strange as I don't know exactly how I came to think that it doesn't check, but am pretty sure that I looked into the code.