Implement win condition checking