Your code failed when there's any input like : 0 1 9
It should output 'Stop' instead of 'Continue'.
Tips :
Do checking step by step, ie. first check for 'Illegal state', then 'Illegal move', 'Move not allowed', 'Stop', and finally 'Continue' if the input pass all the checking. This way your code ...