You could probably implement the three/fivefold repetition rule (https://en.wikipedia.org/wiki/Threefold_repetition#Fivefold_repetition) fairly easily, you just need to record the boardstate at the end of each turn and then end the game if it repeats 3/5 times.