Unfortunately it stops when invalid input happens.Nonetheless, a chess game is not what I expected to be possible with just 23 lines of code :-D
Respect!