Over the past few years there have been many variations of the 'Match 3' computer game. A grid is filled with colored tiles and you may swap two. If the swapped tiles form 3 (or more) in a row or column, they disappear and gravity pulls the upper tiles down to fill the spaces left behind. If more sets of 3 are formed, they continue to clear and you sometimes get cascades of tiles falling and clearing.
Populate a 10x10 grid of squares with colored tiles with:
1. At least 2 colors
2. None 3 in a row
3. Two tiles that are to be swapped forming at least one 3 in a row (or column)
4. Cascades progress as far as possible
5. There are never sets of more than 3 in a row
6. No tiles are added to the board
How can you populate the board so that when the swap is made the board ends with as few tiles as possible?
Example on a smaller board:
Before
54334
54221
42113
After
5
54
44 4
The grid below will clear out when a swap is made in the leftmost column:
|dffcbbdaae|
|aeefccbffa|
|affebbcaae|
|beefccbffa|
|bffebbcaae|
|ceefccbffa|
|cffebbcaae|
|beefccbffa|
|cffebbcaae|
|addfccbdda|
Using capital letters to highlight what changes in each stage, the cascade clears out as follows:
|dffcbbdaae| |dffcbbdaae| | ffcbbdaae| | ffcbbdaae| | ffcbbdaae| | cbbdaae| | bbdaae| | daae| | aae| | e| | |
|aeefccbffa| |aeefccbffa| | eefccbffa| | eefccbffa| | eefccbffa| | FFFccbffa| | ccbffa| | BBBffa| | ffa| | AAA| | |
|affebbcaae| |affebbcaae| | ffebbcaae| | ffebbcaae| | ffebbcaae| | EEEbbcaae| | bbcaae| | CCCaae| | aae| | ffe| | |
|beefccbffa| |beefccbffa| |deefccbffa| | eefccbffa| | eefccbffa| | FFFccbffa| | ccbffa| | BBBffa| | ffa| | AAA| | |
|bffebbcaae| |bffebbcaae| |affebbcaae| | ffebbcaae| | ffebbcaae| | EEEbbcaae| | bbcaae| | CCCaae| | aae| | ffe| | |
|ceefccbffa| |Ceefccbffa| |aeefccbffa| | eefccbffa| | eefccbffa| | FFFccbffa| | ccbffa| | BBBffa| | ffa| | AAA| | E|
|cffebbcaae| |Cffebbcaae| |Bffebbcaae| |dffebbcaae| | ffebbcaae| | EEEbbcaae| | bbcaae| | CCCaae| | aae| | ffe| | FFE|
|Beefccbffa| |Ceefccbffa| |Beefccbffa| |Aeefccbffa| | eefccbffa| | FFFccbffa| | ccbffa| | BBBffa| | ffa| | AAA| | FFE|
|Cffebbcaae| |bffebbcaae| |Bffebbcaae| |Affebbcaae| | ffebbcaae| | EEEbbcaae| | bbcaae| | CCCaae| | aae| | ffe| | FFE|
|addfccbdda| |addfccbdda| |addfccbdda| |Addfccbdda| |DDDfccbdda| | FFFccbdda| | CCCbdda| | BBBdda| | DDDa| | AAA| | FFE|