Bejeweled. Candy Crush. A match-three game always follows the same basic rules, with each one adding its tweaks to gameplay.
A mathematician would describe the state of one such game as a two-dimensional matrix whose elements ("blocks") range in a finite set of colors or shapes.
A valid move swaps the positions of two orthogonally adjacent blocks, and is required to form a horizontal or vertical line of more than two of the same type.
After each valid move, the state of the game is updated by destroying every block that belongs to one such line, then allowing remaining blocks to fall down, while creating new blocks at the top until the board is full again. If new lines are formed, they are also destroyed as soon as all the blocks stop moving.
One can easily form lines of size 3, 4 and 5 by moving a single block inbetween sets of blocks of lengths 1 or 2. However, it is not clear how two create a line of length six, since one side would be too long and break before another block could be placed.
It turns out that, by creating block breaking chains, many blocks can be moved simultaneously, and this allows for the construction of lines of length six and longer:
For the largest lines, it is extremely hard to get the correct positions and timings for each piece. Many of the techniques I used to create these are not easily applied to the other cases, some are completely ad-hoc.
Can you always find a way to construct these lines? Is there a general strategy that works with arbitrarily large lines? Or, otherwise, is there a limit to our engineering possibilities, beyound which the constraints for the system would prevent the existence of new solutions?
EDIT: It seems that the situation is trivial for vertical lines, as a simple setup may make arbitrarily large solutions. The question for horizontal lines still stands.
