lichess-org / scalachess

Chess API written in scala. Immutable and free of side effects.

Home Page:https://lichess.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Threefold repetition not including initial position

rulojuka opened this issue · comments

Just "moving" this bug: lichess-org/lila#7009 to this repository, in order to submit a Pull Request fixing it.

There is an old broken test that is commented "3fold on initial position - broken" that seems to be the exact functionality to fix.

It seems that the initial position is never added to the positionHashes in the History as this is only added in Move.finalizeAfterand Drop.finalizeAfterand is created with the default value of Array.empty when called via the usual Board.init(variant: Variant) that is called inside Game.apply(variant: chess.variant.Variant)