HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
gabrielecirulli
2048
JavaScript2014–2024
gabrielecirulli / 2048

2048

The source code for 2048

15Distinct people
15Mentions
1Explicit recommenders
13.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The source code for 2048

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I like the structure of the game 2048 https://github.com/gabrielecirulli/2048 and I think it will be highly instructive for you since it implements the MVC pattern without…

Kortaggio used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year15 dated mentions

Observed mentions: 2014-03-10 16:30:15 UTC to 2024-09-29 20:56:57 UTC.

02468102014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC918
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC110

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
2048 A small clone of 1024, based on Saming's 2048 (also a clone). 2048 was indirectly inspired by Threes. Made just for fun. Play it here! The official app can also be found on the Play Store and App Store! Contributions Anna Harren and sigod are maintainers for this repository. Other notable contributors: TimPetricola added best score storage chrisprice added custom code for swipe handling on mobile marcingajda made swipes work on Windows Phone mgarciaisaia added support for Android 2.3 Many thanks to rayhaanj, Mechazawa, grant, remram44 and ghoullier for the many other good contributions. Screenshot That screenshot is fake, by the way. I never reached 2048 😄 Contributing Changes and improvements are more than welcome! Feel free to fork and open a pull request. Please make your changes in a specific branch and request to pull into master! If you can, please make sure the game fully works before sending the PR, as that will help speed up the process. You can find the same information in the contributing guide. License 2048 is licensed under the MIT license. Donations I made this in my spare time, and it's hosted on GitHub (which means I don't have any hosting costs), but if you enjoyed the game and feel like buying me coffee, you can donate at my BTC address: 1Ec6onfsQmoP9kkL3zkpB6c5sA4PVcXU2i. Thank you very much!
Read the full README on GitHub

What Hacker News says

15 sources
This looks very nice, great job!! I used to use HN-Special[1] (by the same dev who made that 2048 game[2]) but I stopped a while ago and I don't miss it. I like HN as is (for now), but I do have it at 150% zoom using the native browser built in zoom, which works great for my needs. The one thing I really really want is the equivalent of the "[l+c]" button from Reddit Enhanced Suite. In one click you open both the comments and the submission (if it's just a text one) in new tabs. 1. https://gabrielecirulli.github.io/hn-special/ 2. https://github.com/gabrielecirulli/2048
In Show HN: I made a modern web UI for Hacker News
Kortaggio·May 7, 2015Recommendation phrase
I like the structure of the game 2048 https://github.com/gabrielecirulli/2048 and I think it will be highly instructive for you since it implements the MVC pattern without using a framework, and you want to be framework agnostic. 2048 is simple enough that it's an accessible introduction to software design. Daniel Janus wrote a great analysis of the source code and architecture; I highly recommend reading it: http://blog.danieljanus.pl/blog/2014/04/02/2048/
In Ask HN: Good JavaScript single page applications to learn from
As far as the clone itself uses CSS transforms (if it's Cordova/Phonegap based), it should be fine and usable on mobile. You can recognize the clones using Cordova/Phonegap/Webview if they use the exact same style as G.Cirulli's 2048. Now, to recognize the clones using CSS transforms, that's more complicated. Check for their last release date, it should be strictly after 2014-03-13 (as CSS transforms were added to 2048's repo that day https://github.com/gabrielecirulli/2048/commit/7c6fd1b2a4acb...), and from there, test the apps. I rewrote the whole game's code as an exercice soon after it was released, and took special care in using CSS transforms and not creating/forgetting javascript objects constantly (I wish I knew if that last point made a difference in performance on mobile, but I wouln't know how to measure it). I also added a tut
Read the rest
orial screen and an animation for a forbidden move. That's why I can personally recommend my ad-free clone ('shameless plug' and all that), that you can find here: https://play.google.com/store/apps/details?id=com.erwan.game... or by searching "2+2=2048" in the play store/windows phone store. The swiping mechanic works great with it, so please tell me if you find any issues with it.
In “1024,” “2048″ And Other Copies Of Popular Paid Game “Threes” Fill App Stores
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 :P 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 pla
Read the rest
ying my own game :P EDIT: Make sure not to get addicted! EDIT 2: The game now has swipe gestures and vim keys support (added by @rayhaanj)!
In 2048

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.