As many of you may know, there is a very hard (often called impossible) puzzle present in Reborn. This puzzle is known as the Magic Square Puzzle. The goal of the puzzle is to create two magic squares: a 3x3 grid such that each possible line of the grid adds up to 15. Lines count horizontally, vertically and diagonally. It seems easy, but the hard part is that one move can transform the complete grid. Since I often see people struggling with this puzzle, I created a guide in which I will explain a way to solve it. Please note: this method is not the fastest or the most efficient way to solve it, although it is still better than Marcello’s program that used over 5 million moves.
Let’s start with some terminology. I use a three-character-code for all my moves. The first character says whether you move a column or a row. The second which one and the third says whether it is to the right or to the left or upwards or downwards. Some examples: r3r (row 3 to the right) and c6d (column 6 down).
Say the given board looks like:
9 7 7 | 9 8 2
5 1 6 | 2 6 4
8 4 3 | 5 3 1
There are several possible solutions of this problem. The only important thing is that the 5’s are in the centres. In this guide, I will try to get the following solution.
8 3 4 | 4 9 2
1 5 9 | 3 5 7
6 7 2 | 8 1 6
As you can see, each line adds up to 15. The strategy is to work column by column. You start at the most left column. I suppose that everybody is able to get the first column right. In our case, the grid looks as following. The used moves are: c1d, r2l, c2d, r3l.
8 4 7 | 9 8 2 1 7 2 | 6 4 9 6 3 5 | 3 1 5
Next we try to complete the second column. We will do this by using an algorithm. First, we try to get as many numbers in place by just moving the column. In our case, we can get the 3 and the 7 in correct position by just c2d. The grid now looks like:
8 3 7 | 9 8 2 1 4 2 | 6 4 9 6 7 5 | 3 1 5
Now comes the hardest part. The centre of the left grid should be a 5. Therefore, we search for the most left 5. In our case, this is the 5 in row 3, column 3. We now move the row until the most right correct number from that row (in this case the 1 in row 2) is left of the 5. We then move the 5 to the right row and we undo all the ‘row-moves’ by reversing. In this case we get the 5 in place by: r2r, c3u, r2l.
8 3 4 | 9 8 2 1 5 2 | 6 4 9 6 7 7 | 3 1 5
Now, we keep repeating the algorithm for every column. If you do not understand it yet, please try to follow the next moves. The 4 of column 3 is already in the correct position. The most left 9 is in column 4, row 1. Hence we can get the 9 in position by performing r2r, c4d, r2l.
8 3 4 | 3 8 2 1 5 9 | 6 4 9 6 7 7 | 2 1 5
Since the 2 in column 4 is already in the desired row (row 3), we first move it up. Then we can finish column 3 by moving row 3 once to the right and then place the 2 in place and reverse by moving row 3 once to the left. In total: c4u, r3r, c4d, r3l.
8 3 4 | 7 8 2 1 5 9 | 6 4 9 6 7 2 | 3 1 5
Now the left grid is complete. We repeat once more by first moving the 3 in position (c4u). Then by r1r, c5u, r1l we get the 4 in position and by r3r, c5u r3l we get the 8 in position.
8 3 4 | 4 1 2 1 5 9 | 3 7 9 6 7 2 | 8 6 5
The same way we first perform c5u and then r1r, c6u, r1l and c6d, r2r, c6u, r2l. Now the first 5 columns are perfectly fine. If you are lucky, the sixth one is also correct, but often two numbers need to be switched. In our case we’re fine, since we can solve the puzzle by performing c6u. We solved the puzzle in 31 moves, which is about 5 million moves less than Marcello’s program.
8 3 4 | 4 9 2
1 5 9 | 3 5 7
6 7 2 | 8 1 6
I’ll also show what happens when it is not the case that the sixth column is automatically solved.
8 3 4 | 4 9 2
1 5 9 | 3 5 6 6 7 2 | 8 1 7
This method uses the fact that in your desired solution, the bottom left corner and the bottom right corner contain the same number, in our case a 6. First, we move the upper right corner in place, such that the middle and bottom number of the sixth column should be switched. Then we perform r3l, c6d, r3r, c6u. In this case the puzzle is also solved.
I hope that this guide was useful to you. If you have questions or are stuck, don’t hesitate to ask!