check if the game ends and diaply the winner message