The 7 colors game

The game originated from a C programming course from Anne-Cécile Orgerie and Martin Quinson. The original subject is available here. We present here a version rewritten in D3js and Typescript (source).

This page is a presentation of the game, you can play versus the computer or against another player. You can even try the together js based version to play remotely with friends.

Goal & Rules

The game is made of cells forming a grid. Each cell has a color choosen in a range of 7 colors. The players control a zone and can extend it. To extend his zone, a player choose a color and all the adjacent cells of his controlled zone with this color will be added to it.

The right part is an illustration of a player extending his zone.

restart / step
restart / step
Usually two players play against each other and the winner is the one who controls the largest area at the end - when no more moves is possible for both players.

Some simple strategies

Random
The player choose randomly how to extend his zone, regardless how many cells will abe ctually added.
restart / step
Greedy cells
The player choose the color which maximize the number of cells added to his zone.
restart / step
Greedy groups
The player choose the color which maximize the number of new groups added to his zone.
restart / step

What is the best strategy ?

This is a hard question since there are a lot of possible strategies and a good strategy is probably made of different ones. But let's do something simple : comparing the above strategies.

Random VS Greedy max cells []

restart - launch / launch fast

Greedy max cells VS Greedy max groups []

restart - launch / launch fast

Challenge the Greedy player

Will you beat the AI ?
WINNER
restart