# 2048 (video game)

2048 is a single-player sliding tile puzzle video game written by Italian web developer Gabriele Cirulli and published on GitHub. The objective of the game is to slide numbered tiles on a grid to combine them to create a tile with the number 2048; however, one can continue to play the game after reaching the goal, creating tiles with larger numbers. It was originally written in JavaScript and CSS over a weekend, and released on 9 March 2014 as free and open-source software subject to the MIT License. Versions for iOS and Android followed in May 2014.
2048 was intended to be an improved version of two other games, both of which were clones of the iOS game Threes released a month earlier. Cirulli himself described 2048 as being "conceptually similar" to Threes. The release of 2048 resulted in the rapid appearance of many similar games, akin to the flood of Flappy Bird variations from 2013. The game received generally positive reviews from critics, with it being described as "viral" and "addictive".

## Gameplay

2048 is played on a plain 4×4 grid, with numbered tiles that slide when a player moves them using the four arrow keys. The game begins with two tiles already in the grid, having a value of either 2 or 4, and another such tile appears in a random empty space after each turn. Tiles with a value of 2 appear 90% of the time, and tiles with a value of 4 appear 10% of the time. Tiles slide as far as possible in the chosen direction until they are stopped by either another tile or the edge of the grid. If two tiles of the same number collide while moving, they will merge into a tile with the total value of the two tiles that collided. The resulting tile cannot merge with another tile again in the same move. Higher-scoring tiles emit a soft glow; the largest possible tile is 131,072.
If a move causes three consecutive tiles of the same value to slide together, only the two tiles farthest along the direction of motion will combine. If all four spaces in a row or column are filled with tiles of the same value, a move parallel to that row/column will combine the first two and last two. A scoreboard on the upper-right keeps track of the user's score. The user's score starts at zero, and is increased whenever two tiles combine, by the value of the new tile.
The game is won when a tile with a value of 2048 appears on the board. Players can continue beyond that to reach higher scores. When the player has no legal moves (there are no empty spaces and no adjacent tiles with the same value), the game ends.

### Strategy

Strategies in 2048 include keeping the largest tile in a specific corner with other large tiles filling the row (either vertically or horizontally). If the row remains filled, the player can then move in three different directions while still keeping the largest tile in the preferred corner. As a general rule, no small tiles should be separated from other small tiles by a large tile.

## Development

Nineteen-year-old Gabriele Cirulli created the game in a single weekend as a test to see if he could program a game from scratch. "It was a way to pass the time", he said. He described it as being "conceptually similar" to the recently released iOS game Threes, and a clone of another game, 1024. Developed by Veewo Studio, 1024 is itself a clone of Threes, with its App Store description once reading "no need to pay for Threes". Cirulli's README for 2048 cites another 1024 clone as influence: the homonymous but slightly different in terms of mechanics 2048 by Saming.
Cirulli was surprised when his weekend project received over 4 million visitors in less than a week. The game is free to play, Cirulli having said that he was unwilling to make money "from a concept that [he] didn't invent". He released ports for iOS and Android in May 2014.

### Adaptations

The simple controls allowed it to be used in a promo video for the Myo gesture control armband, and the availability of the code underneath allowed it to be used as a teaching aid for programming. The second-place winner of a coding contest at Matlab Central Exchange was an AI system that would play 2048 on its own. As the source code is available, many additions to the original game, including a score leaderboard, an undo feature, and improved touchscreen playability have been written by other people. All are available to the public.
Spinoffs have been released online and include versions with elements from the Doge meme, Doctor Who, Flappy Bird and Tetris. There has also been a 3D version and versions with bigger or smaller grids. Cirulli sees these spinoffs as "part of the beauty of open source software" and does not object to them "as long as they add new, creative modifications to the game". In 2014, an unofficial clone of the game was published in the iOS App Store by Ketchapp, monetized with advertising. An unofficial clone was also released for the Nintendo 3DS.

## Reception

The game has been described by The Wall Street Journal as "almost like Candy Crush for math geeks", and Business Insider called it "Threes on steroids". Caitlin Dewey of The Washington Post called it "a nerdy, minimalist, frustrating game", while The Independent called it "addictive". The phenomenon of 2048 has been compared to that of Flappy Bird by several commentators. Both games' success, and their simplicity, led to the rapid creation of many variants, and both games have been described as "viral" and "very addictive".
James Vincent of The Independent labeled 2048 as "a clone of a clone". In April 2014, Pocket Gamer reported that 15 new clones of Threes were released daily in the App Store. When asked if he was concerned that his situation would end up as stressed as that of Nguyễn Hà Đông, the creator of Flappy Bird, Cirulli said that he had "already gone through that phase" on a smaller scale, and that once he had decided against monetizing 2048, he "stopped feeling awkward."
In response to rampant cloning, the creators of Threes published a log of how the game evolved over its 14-month development cycle. They said they had tried and dismissed 2048's tile merging variant, because it made the game too easy. In a 2014 Wired article, they claimed to have each beaten 2048 on their first play.

## Use in artificial intelligence research

The mathematical nature of 2048 has made the game of interest to researchers of artificial intelligence. As of 2022, AI achieved over 95% (likely over 98%, but the measurement has noise) probability of making a 16384 tile, over 75% (likely over 80%) probability of making a 32768 tile, and over 3% probability of making a 65536 tile (improving over the results in previous papers). Due to randomness and lack of spare room, the optimal probability of making a 65536 tile is expected to be low; this is supported by optimal solutions for constrained boards.
2048 AI strategy uses expectimax search up to a certain (variable) depth, plus transposition tables to avoid duplication. Analogously to endgame tablebases, tables are used to estimate success (for building a large enough tile without destroying the configuration) in appropriate positions with many large tiles. A position evaluation function can favor empty squares, having a large number of merge possibilities, placement of larger tiles at the edge, and monotonicity for tile sizes, especially for larger tiles. The parameters are optimized by a search for better parameter values; some papers used temporal difference reinforcement learning.