Detecting if game is won.