Let's Play 2048 2048

Logic Level 3

The popular game 2048 2048 was created by programmer Gabriele Cirulli in one weekend. You can play it online here .

Here are the rules of the game (slightly different from the official rules):

  • The game is played on a 4 4 by 4 4 board.
  • At the start, two tiles with values 2 2 or 4 4 (the two tiles do not necessarily have equal values) are placed randomly on the board.
  • The user can swipe in one of four directions, and the tiles move in that direction as far as possible until another tile or the edge of the board stops them. If two tiles with the same value collide, they combine, and the value of the new tile is the sum of the two old tiles that collided. (Note that, once a new tile is formed, it will not combine with another tile of the same value in the same turn. In addition, for each swipe, at least one tile must move.)
  • After each turn, either nothing happens, or a new tile with a value of either 2 2 or 4 4 will appear in a random empty spot on the board. (In the official rules, a tile will always appear.)
  • The game ends when one cannot swipe in any of the four directions (i.e. no free squares available and no collisions of tiles with the same value possible). The score is the number of the tile with the largest value on the board. (In the official rules, the score is calculated in a more complex manner.)

What is the maximum possible score that one can obtain using the above rules of 2048 ? 2048?


Bonus: What is the maximum attainable value for a tile using the official rules of 2048 ? 2048?

2 14 2^{14} 2 15 2^{15} 2 16 2^{16} 2 17 2^{17} 2 18 2^{18} 2 19 2^{19} 2 20 2^{20} \infty

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Nick Turtle
Jun 20, 2018

Let us show that 2 17 2^{17} is the maximum possible number that can be obtained.

First, one can easily show that 2 18 2^{18} is impossible. This is because constructing 2 18 2^{18} requires 2 2 tiles with the value 2 17 2^{17} . Now, suppose that we already have one of the 2 17 2^{17} tiles and are now trying create the second one. That one would require 2 2 tiles with the value 2 16 2^{16} and so on. Ultimately, we find that we need 2 2 tiles with the value 4 4 , but adding up all of the tiles we already have gives us 17 17 tiles in total, which is impossible on a 4 4 by 4 4 board, as seen in the image below.

Note that \(2^{18}=262144\) is impossible. Created with the online game programmed by its creater. It took a couple of hours playing the game until it resulted in this situation (just kidding). Note that 2 18 = 262144 2^{18}=262144 is impossible. Created with the online game programmed by its creater. It took a couple of hours playing the game until it resulted in this situation (just kidding).

Second, one can easily show that 2 17 2^{17} is possible to construct. One way uses a snake-like strategy, gradually increasing the value of a single tile in a corner, with the new tiles appearing only if convenient and always in a convenient location, with the final result shown in the above picture. The exact details are left as an exercise to the reader. I will post one if I have time.


Ok, let's show that 2 17 2^{17} is possible to construct. For this strategy, we just need to have only 4 4 's appearing. Let f ( x , y ) f(x,y) denote a 4 4 appearing at the location of a square ( x , y ) (x,y) on the board, with ( 0 , 0 ) (0,0) denoting the upper left corner, ( 3 , 0 ) (3,0) the upper right, ( 0 , 3 ) (0,3) the lower left, ( 3 , 3 ) (3,3) the lower right, and so on.

Then, follow the below rules:

  • f ( 0 , 0 ) f(0,0)
  • swipe down (bottom left corner is a 4)
  • f ( 0 , 0 ) f(0,0)
  • swipe down (bottom left corner is a 8)
  • f ( 0 , 0 ) f(0,0)
  • swipe down
  • f ( 0 , 0 ) f(0,0)
  • swipe down
  • swipe down (bottom left corner is a 16)
  • f ( 0 , 0 ) f(0,0)
  • swipe down
  • f ( 0 , 0 ) f(0,0)
  • swipe down
  • f ( 0 , 0 ) f(0,0)
  • swipe down
  • f ( 0 , 0 ) f(0,0)
  • swipe down
  • swipe down
  • swipe down (bottom left corner is a 32)

Repeat the above pattern until the squares are, from upper left to bottom left, 4, 8, 16, 32. Then, do the following:

  • f ( 1 , 0 ) f(1,0)
  • swipe right
  • swipe down
  • swipe down
  • swipe down (bottom left corner is a 64)

Yes, we're slowly getting there. Now, you probably see how the building pattern works. Repeat this until we have, from the bottom left square to upper left square, 64, 32, 16, 8. Then,

  • f ( 1 , 3 ) f(1,3)
  • swipe up (note here that this is in the second column and we swipe up, as explained below)
  • f ( 1 , 3 ) f(1,3)
  • swipe up
  • swipe left
  • swipe down
  • swipe down
  • swipe down (bottom left corner is a 128)

Yep, you're probably realizing that this process is similar to the one before. We're slowly building such that the lower left corner has the largest number. However, instead of swiping down as in the first column, we're swiping up for numbers in the second column. Continue this for a certain time, but then you swipe down for the third column and up for the fourth column (a snake-like pattern). Finally, we'll get the result in the picture above, if continued until no spaces are left.

@Nick Turtle Could you please post the details??? I solved this just because I knew this fact from my friend......Sheer luck you might say....

Aaghaz Mahajan - 2 years, 11 months ago

Log in to reply

Ok, I will see if I have time tomorrow. I'm not sure how to describe it, but I might make a video of the first parts.

Nick Turtle - 2 years, 11 months ago

Log in to reply

Much appreciated!!! Thanks in advance....!!

Aaghaz Mahajan - 2 years, 11 months ago

Log in to reply

@Aaghaz Mahajan I have posted it... though it might be difficult to understand. I think making a video might make it more easy, but then it would probably take way too long.

As for the maximum tiles, this only works for the rules modified above. I'm not sure that it applies for the official rules (I suspect that it doesn't).

Nick Turtle - 2 years, 11 months ago

Log in to reply

@Nick Turtle Thanks a lot!!!! Yeah it is a bit too much to grasp at first go, but then I made a diagram and saw what you meant!!!

Aaghaz Mahajan - 2 years, 11 months ago

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...