Game of Squares: Players take turns placing a marker of their own color (say white or black) on the vertices of an 8x8 square grid until there is some square (tilted or not) with all four vertices having the same-colored markers on them. The player whose color it is loses. ... Game of Toral Squares: Same game but on the 64 vertices of GxG, where G is a regular octagon.
How are you defining squares formed from the vertices of GxG? Do you include the "1-dimensional" ones like {a1,c1,e1,g1} (with the I-hope-obvious meaning)? Here's one way, which excludes those: a square is the image of a square in ZxZ under the quotient map (mod 8, mod 8), provided the image vertices are distinct. And here's another which includes them: embed G in R^2 in the usual way and GxG correspondingly in R^4, and then a square is, er, a square :-). I prefer the former way; I think your language implies the latter.
(Microchallenge: How many distinct squares are there in the GxG case, where a square is defined by its set of vertices? Better, generalize to the case of G = the regular N-gon)
I'll adopt my definition above, which may differ from yours. You can get a square with (0,0) as one vertex by picking any other vertex (a,b) and then continuing with (a-b,a+b), (-b,a), and every square with (0,0) as a vertex arises thus. This works unless two vertices are the same, which happens iff (a-b,a+b)=(0,0), <=> (a,b)=(n/2,n/2). So the squares (without a vertex pinned, now) are { { (x,y), (x+a,y+b), (x+a-b,y+a+b), (x-b,y+a) } : x,y,a,b in Z/nZ, (a,b) neither (0,0) nor (n/2,n/2) } and the only remaining question is how many times each square has now been counted when we list the tuples (x,y,a,b). Four times at least, via f : (x,y,a,b) -> (x+a,y+b,-b,a) which has f^4=identity, and all orbits of size 4. And, unless I've goofed, which I probably have, that's all. So the number of squares is if n is odd: n^2(n^2-1)/4 if n is even: n^2(n^2-2)/4 I *think* all that changes if we adopt the embed-in-R^4 definition is that when 4|n we get an extra 2(n/4)=n/2 squares, but my 4-dimensional intuition is pretty dicey and I'm too lazy to check :-). -- g