> > P.S.: There is one point, which is not completely clear to me: > Danny's algorithm always assigns only one square to the player > who did the last move, even if his draw completes two squares, > So in the end the sum of the points may be less than (w-1)*(h-1). > Is this according to the rules of the game? > no. If your move boxes in any number of squares you get all of them.