Three-Color Territory Puzzle

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

A board is covered with "polysquare" areas, each painted in one of three colors. The value of a blue polysquare is the square of its land area, hence a pentasquare is worth 25 points.


Yellow tiles have no value. The value of a red tile is the negative value of the corresponding blue tile.

Click a polysquare to own it (which is then marked by black dots). From your second move onward you can only click next to an already-occupied position.

Your task is to create a region of ownership that comprises an area of half the size of the board (50 or less) and at the same time collect as many points as possible.


Contributed by: Karl Scherer (January 2016)
Open content licensed under CC BY-NC-SA



In politics, gerrymandering is the act of redefining electoral zones in order to predispose the voting results of an election in a certain direction (based on race, religion, political views, wealth, etc).

In this game, you have to try to score as many points as possible by taking control of polysquare areas.

At the same time, your "sphere of influence" cannot be larger than half of the board.

For each board size (10x10, 15x15, 20x20, or 25x25), you have a choice of using a fixed setup or letting the system generate a random setup. For the fixed setups, a target number of points is given at the left border.


Click "challenge" to select the board size (10x10, 15x15, 20x20, or 25x25).

Click "randomized?" if you want a random setup. Click again to use the fixed setup. This toggle is only available if you have not clicked a position yet.

Click "reset" to go back to the beginning.

Click "new" to use a random setup and randomize the setup immediately.

Click "take back" to go back one step (undo your last move).

Click "tile value linear/square" to give each blue area either the value equal to the tile's size or to the square of the tile's size. The value of the yellow areas is always zero. The value of a red area is the negative of the value of the corresponding blue tile.

Below the controls there is data displayed on the left: - "number of areas owned" (number of polysquares with black dots) - "area size" (of last-clicked area) - "value" (of last-clicked area) - "max size" (maximum total occupied area allowed) - "target" (accumulated value of largest known solution) - "total size" (total area of solution) - "value" (total value of solution)

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.