Voronoi (the game)
- Ten random points in a grid make Voronoi cells.
- Players R and B alternate placing points on the grid for red and blue Voronoi cells. (Alt+click)
- First to connect three sides wins.
Here’s some code I came up with for it.
DynamicModule[{p=RandomReal[{-1,1},{10,2}]},LocatorPane[Dynamic@p,Dynamic@Show[VoronoiMesh[p,
ImageSize-> {500,500}, MeshCellStyle->Table[{2,n}-> If [n>10,If[OddQ[n],Red,Blue], Gray],{n,1,Length[p]}]],
Graphics[Table[{If [n>10,If[OddQ[n],Red,Blue], White],Text[n,p[[n]]]},{n,1,Length[p]}],ImageSize-> {500,500}]],
LocatorAutoCreate->True, Appearance-> None]]
It doesn’t quite work, though – the cell order doesn’t correspond to the Point order. That makes the game a lot more random.
So… some questions.
- Is there a good strategy for the current random game?
- Is there a fix for the code? Can it be made shorter?
- Is there a strategy for the fixed game?
- Can an AI be made for one or both of the colors?
- If the game is too easy with 10 initial points, how many points make the game interesting?
