Thanks for the feedback, The reason why there is no Threefold Repetition is that the game engine I used is very restrictive. It's a small wonder I got the AI to work as it is. But I'm considering a port to a different engine and I might get the Treefold Repetition going there.