2048
The source code for 2048
The original open-source browser game 2048, a sliding-tile puzzle where you combine numbered tiles to reach 2048. Runs in any web browser with no install needed.
This repository holds the source code for 2048, the well-known sliding-tile puzzle game that runs in a web browser. The author, Gabriele Cirulli, describes it plainly as a small project made just for fun, and the README links to a page where you can play it directly.
The README is upfront about the game's origins. It calls 2048 a clone of an earlier game called 1024, which was itself based on another version, and it credits the game Threes as an indirect inspiration. In other words, the author is open about building on ideas that already existed rather than claiming the concept as original.
Most of the README is given over to thanking people. It names two maintainers and lists several contributors along with what each of them added: storage for your best score, swipe handling on mobile devices, swipe support on Windows Phone, and support for an older version of Android. There is also a note thanking many others for smaller contributions. A screenshot is included, and the author jokes that the image is fake because he never actually reached the 2048 tile himself.
For people who want to get involved, the README invites changes through forking and pull requests, asks that work be done in a dedicated branch, and points to a separate contributing guide for the same instructions. The code is released under the MIT license, a permissive open-source license.
The README closes with a short note that the project was made in spare time and hosted on GitHub at no cost, along with a Bitcoin address for anyone who wants to leave a small donation. Overall this is a simple, personal project page rather than a formal product README.
Where it fits
- Fork the repo and add a new game mode, board size, or custom tile theme.
- Study how a viral browser game is built using plain JavaScript with no framework.
- Embed the game on a personal or educational website as an interactive example.