Problem

Button Madness is a game with a four by four grid of square buttons. Each button can have one of two colours: red or green. Pressing one of the buttons will change the colour of that button as well as all of the buttons vertically and horizontally adjacent to it (with the effect wrapping around the top, bottom, and sides of the grid). The object is to push the buttons so that they all of have the same colour (either green or red).

An example of the game can be seen here.

You can also find other variations of the game at the Magic Seal Game.

Solution

Due to the configuration of the Button Madness board, the solution is pretty simple. To change a single button from red (up) to green (down) or visa versa, one must press that button as well as each of the buttons horizontally and vertically adjacent to it.

To demonstrate how this works, we shall use the diagram below to illustrate our point.

0 0 0 0 | 0 0 0 0  0 0 1 0  0 0 1 0  0 0 2 0  0 0 2 0
0 0 2 0 | 0 0 1 0  0 1 2 1  0 2 2 1  0 2 2 1  0 2 2 2
0 3 1 5 | 0 1 1 1  0 1 2 1  1 2 3 1  1 2 4 1  2 2 5 2
0 0 4 0 | 0 0 1 0  0 0 1 0  0 1 1 0  0 2 2 1  0 2 2 2

The first grid shows the order in which the buttons are pressed. In the following grids, the numbers represent the number of times that that specific button has changed colour. By the time we've pressed the fifth button, we see that most of the buttons have changed colour twice, meaning that they have effectively stayed the same! The only button to have changed colour in the end is the middle button. Therefore one can selectively change the colour a button on the grid without affecting the rest of the board.

With this method, one can convert the entire grid into a single colour or a specific pattern no matter what random pattern of colours is generated in the beginning of the game.

One variation of the game has a rule that does not allow clicking on a button that is already down. There is a simple way around this issue: By changing the order of the sequence above, one can obtain the same result without having to press on a button that is already depressed.

0 0 0 0 | 0 0 1 0  0 0 1 0  0 0 2 0  0 0 2 0  0 0 2 0
0 0 1 0 | 0 1 1 1  0 1 1 2  0 1 1 2  0 2 1 2  0 2 2 2
0 4 5 2 | 0 0 1 0  1 0 2 1  1 0 3 1  2 1 4 1  2 2 5 2
0 0 3 0 | 0 0 0 0  0 0 0 1  0 1 1 2  0 2 1 2  0 2 2 2

Notice that only the buttons which have an even number (up position) are pressed.

This variation becomes more difficult if the layout starts with buttons already pressed. I haven't figured an elegant method to approach this problem yet.

Note:

To minimize the number of button presses, one can check each button to see if it has an odd number of red squares touching it vertically or horizontally including itself. If so, then press the button and move on to the next button. In so doing one can complete the puzzle in sixteen presses or less. I have yet to put a proof together for that.

Tuesday, October 15, 2024 @ 20:25:44 EDT

« List of pages on this site:

« List of recent entries:

« List of recent comments:

« List of recent links:

« List of random quotes:

"I love being a writer. What I can't stand is the paperwork."

Peter De Vries (From The Quotations Page.)