http://www.chess.com/livechess/game.html?id=61071207
here is an example of live chess bugging out on three fold repetition... see moves 35 37 39... draw button was pushed before after and during move 39 - but no draw... to top things off... i lost as a result.
Actually, this example shows the code is incorrect in two ways. The position rooperi offered a draw in was the starting position, and had been reached 3 times. It is necessary to check that this is not merely a problem with this rather special case (no moves have been played to reach the starting position for the first time). But there is little doubt about the generality of the second valid draw claim, for the position after playing Nf3 the third time. Work to be done here.
rooperi, I would like to check the code in a similar way in live chess some time if you are available. My impression is that you can only claim the 3-fold repetition there after the position has been created by one player or the other. This is insufficient, as I stated.