TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: 2048 in 2048 bytes

76 点作者 rwinn大约 11 年前

21 条评论

jader201大约 11 年前
There are a few differences with this version:<p>- The game allows a new tile to spawn even if you move in a direction in which no tiles move.<p>- Only 2 tiles spawn. I don&#x27;t think I&#x27;ve ever seen a 4 tile spawn.<p>- Once you reach 2048, the game continues.<p>Does anyone know whether these are intentional, or a side effect of the 2048 byte limitation?
评论 #7407730 未加载
评论 #7407204 未加载
评论 #7407170 未加载
bite大约 11 年前
I beat it <a href="http://imgur.com/xa0sXjX" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;xa0sXjX</a> . I think this game is significantly easier than original due to the alterations in logic: - When you&#x27;re unable to move (for instance when the top 2 rows are all filled with 8 blocks), you can still spawn a new block. Just lot less challenging than pressing down than up and dealing with 2&#x2F;4 surrounded by high numbers. - You only spawn two&#x27;s no four&#x27;s this allows for a much easier strategy. I probably used the right and up key about 90% of the game, left 9%, and down &lt;1%.<p>Great job though! loving all these clones.
gus_massa大约 11 年前
Nice work. There is a small incompatibility when you press a key and no tile moves &#x2F; collapses. In the original version it doesn&#x27;t count and a move and nothing happens. In this version a new tile appears.
评论 #7406785 未加载
评论 #7406822 未加载
kps大约 11 年前
2048 in exactly 2048 bytes of C, counting blanks and newlines (a bit of a cheat to use indentation to push it up to 2K).<p><a href="https://gist.github.com/datatravelandexperiments/9578313" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;datatravelandexperiments&#x2F;9578313</a><p>Needs C99 and curses; e.g.<p><pre><code> cc -std=c99 2048.c -lcurses </code></pre> Note: This is pretty awful code, but I&#x27;d rather go to sleep than use up the blanks to make it cleaner. Don&#x27;t write like this.
评论 #7408384 未加载
Aardwolf大约 11 年前
I continued playing after 2048, now I have two 2048&#x27;s next to each other, they refuse to form a 4096, and the game doesn&#x27;t respond to keystrokes anymore :(<p>The changed rule that allows spawning blocks at any time makes it easier indeed, but not that much easier, so nice modification.
评论 #7407072 未加载
pkill17大约 11 年前
Buggy; Got some sort of JS alert error that stopped my game short: &quot;GG 308&quot;, &quot;GG -1&quot;. I&#x27;m guessing you&#x27;re reporting my score here, but there are still MANY valid moves left on the board. For example, start the game, and hold the down arrow until the alert pops up saying &quot;GG [score]&quot; -- There&#x27;s almost guaranteed to be 4-5 possible moves left on the board this way.
评论 #7406802 未加载
Cynddl大约 11 年前
Not the same rules. :)<p>We should not be able to make new card appear when no other one can move.
评论 #7406734 未加载
评论 #7406732 未加载
eudox大约 11 年前
I really like the design of this one more than that of the original.
doorhammer大约 11 年前
Good job!<p>I won&#x27;t point out the bugs&#x2F;differences that&#x27;ve been mentioned. I dug it, either way.<p>What really hit me, playing this version, is how much relatively small changes in a really simple game can dramatically alter the strategy and difficulty of the experience<p>Dug it either way though
randallma大约 11 年前
Something seems wrong with this picture: <a href="http://i.imgur.com/nTL4DZi.png" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;nTL4DZi.png</a><p>(Just keep on pressing right to reproduce)
评论 #7407042 未加载
评论 #7409189 未加载
rwinn大约 11 年前
Updated it to follow the original better. You try the updated version here:<p><a href="http://johan-nordberg.com/2048/" rel="nofollow">http:&#x2F;&#x2F;johan-nordberg.com&#x2F;2048&#x2F;</a><p>(or if you&#x27;re in the future the js1k crew might have updated my submission already, in that case, forget you read this, it was perfect from the start, whoa i need a break, my brain is trying to find ways to write this comment using fewer characters, commas are nice, sleep)
feelstupid大约 11 年前
Basically, the &#x27;check&#x27; to see whether you have any moves left isn&#x27;t in fact whether there are moves left, it&#x27;s just a simply &#x27;if no more space for new block = game over&#x27;<p>The addition of the block being added no matter the move is an escape round the original (and obviously more verbose, probably why excluded) method of calculating moves remaining.<p>All in all, decent effort, but it&#x27;s not 100% true to it&#x27;s aim
Dorian-Marie大约 11 年前
Maybe there should be some standard rules for 2048, because I tried three games, the original, the Android one and this one, and everytime there are different rules: - Is it a valid move to not make any tile move? - What is the order of tiles merging (top-first? left-first?) - Can we merge multiple tiles in the same row&#x2F;column in one move? - ...
joering2大约 11 年前
Can someone please make a 4096 version, or 8192 ?? I love this game, but I ended up with almost empty board with one 2048 tile and 2 x 2.<p>I want to be able to go on! :)<p>EDIT: I bet this would be a smash hit in Apple Store (at least I checked and couldnt find exact replica). I bet there are few people working on it right now...
icefox大约 11 年前
Every move causes the whole page to flicker in Chrome on my box which makes it pretty unplayable.
评论 #7407011 未加载
评论 #7407218 未加载
feelstupid大约 11 年前
If I press UP and only UP, it will have the 16&#x27;s in the top row, 8&#x27;s in the 2nd, 4&#x27;s in the 3rd, and 2&#x27;s in the 4th without fail. It then says GG 272 even though I have more moves.<p>Out of 3 times playing, it has some this 3 times.
Schiphol大约 11 年前
This should probably be in the thread for the original program, but I didn&#x27;t do it then, and I feel I&#x27;m missing out: my arrow keys do nothing, and NoScript is allowing the whole page. This is FF 27. Am I missing something?
PanMan大约 11 年前
Unfortunaly doesn&#x27;t work on iPad (no swipe support) while the original does
评论 #7407188 未加载
shakeel_mohamed大约 11 年前
Somehow, I beat this version my first try! Partially because I got a 3x4 deadlock, but a new tile spawned in the empty row and I could keep going.
mschuster91大约 11 年前
Bug: GoodGame with:<p><pre><code> 2 2 4 2 32 16 8 4 64 128 64 16 1024 512 256 128</code></pre>
评论 #7406950 未加载
akst大约 11 年前
Woo, Good Job Johan!