A friend downloads this game called Threes a couple weeks ago. It’s currently $2 on iPhone and Android. My friend called it the Tetris of our day, and, I have to admit, it is easy to understand, challenging, and fun. Before getting the chance to write about it, an interesting lineage of clones appeared.
Cloned. The basic mechanic that has been reproduced is the adding of (matching) numbers within rows and columns, depending on direction of swipe. Soon after, a game, which could’ve been named “Twos,” called 1024 emerges with a similar art-style.
There are three notable branches of the 2048 puzzle on github:
- the initial port: http://saming.fr/p/2048/
- the same game, but with an animation makeover: http://gabrielecirulli.github.io/2048/
- the same game with AI assistance: http://ov3y.github.io/2048-AI/
Right after 1024, the 2048 game, with the animation makeover, becomes a viral hit. When I saw it, I thought, “well, it looks like someone made a free web version of Threes.”
I did a bit more research to find the author of the viral game on Hacker News (four days ago).
Hey, author here! I’m pretty overwhelmed that this made it to the top of HN without me even thinking of posting it here 🙂
I made this game as a fun weekend project, inspired by another game called 1024 (https://itunes.apple.com/us/app/1024!/id823499224) and a spinoff called 2048 (http://saming.fr/p/2048/). I did mine to add animations to the latter, which was a bit hard to play without them.
I discovered Threes only today, and I had no idea it looked so similar. I searched a bit and it appears as if 1024 is also inspired by Threes, so my game is probably the last of a long chain of clones 😛
The code is also open-source. You can find it here: https://github.com/gabrielecirulli/2048
Feel free to ask me anything, and thanks to everyone for the attention! 🙂
By the way, my highscore is somewhere around 6000. Admittedly, I’m quite bad at playing my own game 😛
EDIT: Make sure not to get addicted!
EDIT 2: The game now has swipe gestures and vim keys support (added by @rayhaanj)!
In case it’s still confusing, I made a quick diagram to show the lineage of clones:
The difference between gabriele’s and ov3y’s is hard to detect at first, but if you look at the top, there are two additional buttons for “Get Hint” and “Auto-run/Stop.” You can basically watch ov3y’s AI beat the game before your eyes.
You can view the source here: https://github.com/ov3y/2048-AI
The algorithm is iterative deepening depth first alpha-beta search. The evaluation function tries to keep the rows and columns monotonic (either all decreasing or increasing) while aligning same-valued tiles and minimizing the number of tiles on the grid. For more detail on how it works, check out my answer on stackoverflow.
You can play the game here: http://ov3y.github.io/2048-AI/
AI solver by Matt Overlan
- It’s great that Threes creates such a new experience that’s simple, challenging, and fun.
- In context, it seems quite common, but still feels a bit messed up to copy someones game and then give it away for free with the tagline of: “why pay for it, when you can get it for free?” Pretty smart move though, from a $$ point of view.
- Github is cool.
EDIT: Here’s the best spinoff: http://games.usvsth3m.com/2048/triad-edition/