TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

HN Plays 2048

280 pointsby computerabout 11 years ago

36 comments

Oculusabout 11 years ago
Took a look at your code and noticed you&#x27;re using Socket.io. Don&#x27;t use Socket.io for anything over double digit concurrent users. It&#x27;s well known to be horrible at scaling. If you want something that&#x27;s <i>better</i> at scaling I&#x27;d suggest SockJS[1].<p>1 - <a href="https://github.com/sockjs/sockjs-node" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sockjs&#x2F;sockjs-node</a>
评论 #7434347 未加载
评论 #7434304 未加载
评论 #7433964 未加载
评论 #7434568 未加载
评论 #7434092 未加载
评论 #7433841 未加载
评论 #7434234 未加载
granttimmermanabout 11 years ago
Hey guys, it&#x27;s the creator here.<p>I never thought this little project would get this big!<p>If someone wants to help me scale this, or add things like chat, please do! Just send a PR on Github!<p><a href="https://github.com/grant/hnplays2048" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;grant&#x2F;hnplays2048</a>
评论 #7434032 未加载
grejabout 11 years ago
Kind of fun, but I agree with some of the other comments that it would be interesting to see what would happen if the app made a move every 15-20 seconds based on the vote tally in that time window.
评论 #7434065 未加载
评论 #7433924 未加载
评论 #7433993 未加载
评论 #7433734 未加载
coleptabout 11 years ago
This game is no more playable than it was when it was posted hours ago. And here&#x27;s why:<p>setInterval(function() { window.manager.inputManager.emit(&quot;move&quot;, Math.floor(Math.random() * 3) + 1); }, 1000);<p>Some rate limiting has been put in place, but it&#x27;s not good enough. If there are 50 users online at once, they all shouldn&#x27;t be able to spam a command every second.<p>A better algorithm would be:<p>seconds_between_commands = 60 - (60 &#x2F; number_of_players);<p>With a clock letting you know when you can make your next move.<p>Otherwise, it&#x27;s just way too easy to spam.
评论 #7433724 未加载
begriffsabout 11 years ago
It&#x27;s currently unplayable. Instead imagine if it would make one move every half a minute. During the time between moves anyone could vote on the next move. Then the winning move would be played. It would be a slow game, but would be the aggregate HN wisdom.
评论 #7433651 未加载
评论 #7433650 未加载
dbieberabout 11 years ago
I added democracy mode...<p>The pull request is here: <a href="https://github.com/grant/hnplays2048/pull/10" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;grant&#x2F;hnplays2048&#x2F;pull&#x2F;10</a><p>You can play it here: <a href="http://hnplays2048-democracy.herokuapp.com/" rel="nofollow">http:&#x2F;&#x2F;hnplays2048-democracy.herokuapp.com&#x2F;</a>
评论 #7434037 未加载
评论 #7434047 未加载
评论 #7434422 未加载
bhaumikabout 11 years ago
Is this HN&#x27;s version of twitch plays Pokemon? <a href="http://www.twitch.tv/twitchplayspokemon" rel="nofollow">http:&#x2F;&#x2F;www.twitch.tv&#x2F;twitchplayspokemon</a>
评论 #7433639 未加载
lergabout 11 years ago
I&#x27;ve made a version of 2048 on Hexagonal Board - check it out <a href="https://play.google.com/store/apps/details?id=com.spiralcodestudio.hexled" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.spiralcode...</a>
spajusabout 11 years ago
This makes a perfect illustration why startups are shit. Instead of working on something useful, people either produce crappy javascript games, or play them. Now massively downvote this comment, write 100 replies explaining why I&#x27;m wrong and how retarded I am for trying to say something like this, then go read something by Paul Graham and play more clones of 1024. And then write a long essay why your startup failed.
Smirnoffabout 11 years ago
Damn, this version seems so unplayable-- so much chaos. When I play on my own, I already do so many random moves until I reach 512. After that every move that I make is evaluated. I have no problems reaching 2048 (or 29,000 points) within 10-15 minutes.<p>Here, I just get frustrated with the slowness of the moves (not to mention the strategy of the &quot;democratic group&quot; is way off)
vinh0811about 11 years ago
Here is my app for Android: <a href="https://play.google.com/store/apps/details?id=com.contrarykid.twos" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.contraryki...</a>
评论 #7433955 未加载
评论 #7435010 未加载
munimkaziaabout 11 years ago
Utter chaos going on in the game over there. But it&#x27;s a fun experiment.
namenotrequiredabout 11 years ago
I think someone figured out how to unleash its AI on this :)
评论 #7432455 未加载
ghiculescuabout 11 years ago
This is probably a bit much, but I&#x27;d love to see someone whip up a multiplayer 2048 using something like Firebase. It would probably start many an argument.
granttimmermanabout 11 years ago
There&#x27;s also an api: <a href="http://hnplays2048.herokuapp.com/api" rel="nofollow">http:&#x2F;&#x2F;hnplays2048.herokuapp.com&#x2F;api</a><p>:)
martinthenextabout 11 years ago
It&#x27;s pretty interesting how the strategy derived by averaging over multiple intelligent users can be that sub-optimal.
cribwiabout 11 years ago
Funny to see a new player entering the game to start button bashing and ruining the playing field in a matter of seconds :)
joeblauabout 11 years ago
Can someone index all of these versions :)
comrhabout 11 years ago
This seems to show what I thought when I originally saw the game, that random spamming would get you pretty far.
coreymgilmoreabout 11 years ago
It would be nice to know your own user #.
评论 #7433712 未加载
Dobbsabout 11 years ago
This needs a delay. That way you can follow the chaos instead of just staring at a moving screen.
yaddayaddaabout 11 years ago
<a href="http://xkcd.com/1344/" rel="nofollow">http:&#x2F;&#x2F;xkcd.com&#x2F;1344&#x2F;</a>
tomaskazemekasabout 11 years ago
It is a good demonstration that in cases like this user democracy is a loosing strategy.
granttimmermanabout 11 years ago
Man... scalability sucks.
gk1about 11 years ago
A-a-and it&#x27;s down.
mcescalanteabout 11 years ago
Another case of &quot;HN crashes the heroku app&quot;
评论 #7433969 未加载
Cub3about 11 years ago
We really need a democracy mode for this
评论 #7434074 未加载
azinman2about 11 years ago
I really don&#x27;t like to hate on other people&#x27;s work but seriously more 2048 forks? And now ones that aren&#x27;t even remotely playable?
评论 #7433754 未加载
fidzabout 11 years ago
Any idea on handling transaction?
kregasaurusrexabout 11 years ago
Start9
评论 #7434016 未加载
theandrewbaileyabout 11 years ago
seems like it falls victim to popularity, and crashes often.
评论 #7433765 未加载
maaarghkabout 11 years ago
holy hell this makes me hate you all! =P
joyeuse6701about 11 years ago
the chaos.
evidencepiabout 11 years ago
Crashed!!
mkoryakabout 11 years ago
you guys really suck at this game.
评论 #7434319 未加载
ankit84about 11 years ago
A joKE?