checks if X's or O's win, and responds appropriately