Added continuous loop recognition, the game stops if it finds that it is
in a continuous loop.  This logic only recognizes loops where one state
is identical to the state directly following it