win conditions for vertical and horizontal