The Gordon game is a game to be played by two people who know a bit about group theory (and by a bit, it’ll suffice to read my introduction to group theory). I found of the game in the book “Adventures in Group Theory: Rubik’s Cube, Merlin’s Magic and Other Mathematical Toys” by David Joyner.
According to the book, the rules are as follows. Take two copies of a set corresponding to the group and call one
and the other
. The rules are then as follows:
- Player one chooses an element
from the group
and
from
. These can be any element he chooses, and once they are chosen they are removed from the sets
and
- The next player chooses an element
and
such that
. Both elements are removed from their respective sets.
- Repeat the previous step. The first player that cannot move loses.
I’ve written a program in C++ that will compile under GCC. The group used here is , that is, the integers modulo 7. You can download it here, although this link may change after I graduate. I wrote it hastily, so it’s not commented well and it probably has bugs. To compile, use the command
g++ gordon.cpp -o gordon
I can compile it fine on OpenSUSE 11.0. There’s no AI yet, so it simply switches between two human players. In the future, I may add support for user-defined groups and possibly some rudimentary AI.
Enjoy!
UPDATE: I updated the program a little bit so that you can make your own groups. As a result, you’ll now need to download the default file, z7z.grp, if you want to be able to run the program.
To make your own groups, follow this recipe:
- On the first line, list all of the group elements separated by a space and followed by an exclamation mark.
- Now just list the multiplication table, with a space between columns and a new line between rows.
For example, the group looks like this:
0 1 2 3 4 5 6 !
0 1 2 3 4 5 6
1 2 3 4 5 6 0
2 3 4 5 6 0 1
3 4 5 6 0 1 2
4 5 6 0 1 2 3
5 6 0 1 2 3 4
6 0 1 2 3 4 5
To use your new group, pass it on as a command line argument, i.e. run
./gordon mygroup.grp
That’s it! Try it with a complicated group, for example a large order dihedral group.