2048 Puzzle Introduction

Source: Internet
Author: User

2048 puzzle is currently a very hot mobile phone game. You'll often see people playing this game on the subway.

First, simply introduce the 2048 puzzle game. The game interface is a 4x4 square, where you can place a number in each square. There are four ways to move numbers, left, right, up, and down. When moving in one direction, all numbers move in this direction until they reach the boundary, or the numbers block. And in the moving direction, the same numbers in the connected squares will be merged. After each move, 2 or 4 digits are randomly found in the blank squares and may not appear.

Success Condition: Close the number 2048.

Failure condition: All squares have numbers, and no number can be combined in either direction (no number in the connected lattice is the same). That is, four of all directions are blocked.

The strategy is to keep the following four rules in accordance with the rules and to avoid the two anomalies that will be mentioned next.

Rule 1) Always place the largest number in the upper-left square, and the number in the upper square in the first column is always no smaller than the number below. (This rule is to be observed, in addition to note that this is a mirror symmetry, for the sake of convenience, I will directly take the upper left corner as an example, the following rule description is the same)

Rule 2) All squares in the first column have numbers. (This rule may not always be maintained.) In the course of the game, it is possible to be destroyed, but to restore this rule as soon as possible)

such as Shape 1 and shape 2. Where shape 1 is satisfied with Rule 1 and Rule 2, and shape 2 satisfies rule 1 only.

Shape 1

512

32

256

16

128

8

68

2

Shape 2

512

32

256

16

128

8

2

The way to keep rules 1 and 2 is to always keep only the left, move up and down, and not move to the right in the game.

Rule 3) Try to control the size of the number in the second column. Ideally, all the numbers in the second column are smaller than the first column; the worst case scenario is that the number in the second column appears larger than the second row of numbers in the first column. (This is not necessary, but if you try to keep this rule, you can benefit from the growth of the first column of numbers)

As in shape 3, 256 and 64 appear in the second column. Will hinder the growth of the first column of numbers.

Shape 3

512

32

32

64

16

8

8

the

2

The way to maintain rule 3 is to prioritize merging numbers into row Fourth of the first column, and merge if the numbers in the second column have the opportunity to merge into the first column (note that you want to keep rule 1). This is just a mentoring program, there will be a lot of situations in the game, there may be better choices, but also need to improvise.

In Shape 4, the fourth row of numbers in the second column is first merged into row Fourth of the first column.

Shape 4

512

2

32

16

16

8

2

2

2

In shape 5, the second column of the third row of numbers merges the third row of numbers in the first column.

Shape 5

512

2

32

2

16

16

2

8

2

Rule 4) Do not appear in column fourth greater than or equal to 16 digits, and do not appear in the third column greater than or equal to 32. (This rule is not required, but can effectively prevent it from being blocked).

In the case of shape 6, in violation of rule 4, we can only merge two 2 in the lower left corner.

Shape 6

512

4

32 2

64

2

16 8

32

16

64 16

2

8

2

2

Two anomalous shapes, one I call the run shape, the other called the helpless shape.

1) Luck shape

In addition to the downward, the other direction was blocked. And there are only three squares on the left with numbers (not satisfying rule 2). As in shape 7.

Shape 7

512

4

8

2

32

2

16

If you're lucky, the 2 or 4 numbers that appear are not in the upper-left corner, and you can restore rules 1 and 2 (which is why I call it a running shape). As in shape 8, it is bad luck after moving down, 2 appears in the upper left corner, unable to restore rule 1.

Shape 8

2

512

32

4

16

2

8

2

2) Helpless type

Except to the right, other methods were blocked.

Once moving to the right, if the number 2 or 4 appears, it must appear on the left. Then again want to move to the right to restore Rule 1 is difficult (only a small probability will recover, but we can not expect this to happen, all I call it a helpless shape). As in shape 9, it is this shape, move to the left after the shape 10, and then can not maintain rule 1.

Shape 9

1024

8

512

64

32

4

16

8

Shape 10

1024

8

2

512

64

32

4

16

8

In our game to try to avoid the appearance of these two shapes, especially the helpless shape, once it happens it is difficult to restore rule 1. I think of a way to avoid this is to feel the two forms, you can move up and down several times, more than a few 2 and 4 numbers, to avoid the occurrence of these two anomalies.

Why rule 1 and rule 2 are met

Analysis of the game, you can find that the number is 2 of the N power. Each digit growth is a power plus 1. As in shape 11, the left row has a top-to-bottom sequence of 2a,2b,2c,2d. Meet rule 1 Description, A>=b>=c>=d.

Shape 11

2a

2b

2c

2d

Since each number increases by a power of 1, each number increases by any number in the grid larger than it. So if we keep rule 1, we have the chance to merge the numbers from the bottom up in the left row.

If we do not maintain rule 1, then it will increase the difficulty of the game, and even eventually lead to four of the direction of blocking the dead. As in shape 12, does not satisfy rule 1, the first column in the second row of the number U is the largest number 512, the first column in the first row of the number V is 2, the first column in the third row, the number w is 256. If the number u is always the largest number. Then the numbers u and V are difficult to merge, regardless of how they change in the future. Is coincidentally merged together, but there will be another two numbers separated by U.

Shape 12

2

8

512

16

256

32

2

There is a very special shape in this discussion, such as Shape 13, two 512 is separated by 1024. If no new number 2 or 4 appears, this two number 512 cannot be merged together. Even if there are 2 and 4, it is difficult to merge together in coincidence. Although the two 512 is difficult to merge into 1024, but the shape 5 is still possible success, because the game will continue to appear in the movement of the number 2 or 4, so you can close the third 512 and the previous 512 merge, and eventually merged into 1024 2048.

Shape 13

512

1024

512

The final note is that the game in violation of rule 1, does not mean that can not be successful, but it will be more difficult. In addition, if you have a better way, you can communicate together.

2048 Puzzle Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.