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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A game whose source code fits in one tweet

162 点作者 eigenbom将近 10 年前

22 条评论

arocks将近 10 年前
If you liked this then you might find my Python one liner games interesting [1]. They fit a tweet in most cases.<p>[1]: <a href="http:&#x2F;&#x2F;arunrocks.com&#x2F;python-one-liner-games&#x2F;" rel="nofollow">http:&#x2F;&#x2F;arunrocks.com&#x2F;python-one-liner-games&#x2F;</a>
评论 #9803880 未加载
评论 #9803741 未加载
评论 #9802854 未加载
escherize将近 10 年前
I&#x27;m sorry I&#x27;m a dirty cheat: <a href="http:&#x2F;&#x2F;fetchh--captured.s3.amazonaws.com&#x2F;Monosnap_2015-06-30_14-51-27.png" rel="nofollow">http:&#x2F;&#x2F;fetchh--captured.s3.amazonaws.com&#x2F;Monosnap_2015-06-30...</a><p><pre><code> while(true){f()}</code></pre>
shubhamjain将近 10 年前
OP can save a few more characters by not using &#x27;var&#x27; and using &#x27;E&#x27; notation for representing 15000, i.e, 15E3, or better, 2E4.
评论 #9803385 未加载
评论 #9803125 未加载
Omnus将近 10 年前
Author here - I&#x27;ll implement some of these suggestions and see if the extra space might allow for something a little more interesting. It&#x27;s a pleasant surprise to see a pull request on this little thing.
xem将近 10 年前
Cool! some suggestions:<p>- show it on <a href="http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;tinycode&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;tinycode&#x2F;</a><p>- if you aim for low character count instead of low byte count, you can pass your code through my unicide packer here: <a href="http:&#x2F;&#x2F;xem.github.io&#x2F;obfuscatweet&#x2F;" rel="nofollow">http:&#x2F;&#x2F;xem.github.io&#x2F;obfuscatweet&#x2F;</a><p>- Golf your code even more (using the tips of the other comments), and use all the remaining chars to add features to your game and fill the 140 chars of a tweet :)<p>Cheers
chrismorgan将近 10 年前
I cut the size down by 39 bytes in <a href="https:&#x2F;&#x2F;github.com&#x2F;omnus&#x2F;tiny-twitch&#x2F;pull&#x2F;1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;omnus&#x2F;tiny-twitch&#x2F;pull&#x2F;1</a>. You can trade 36 of those bytes for “legal HTML 5” status, too.
eigenbom将近 10 年前
A few of us were doing this over on Twitter, with the typical &quot;guess a number&quot; games. But Alex&#x27;s was the best so far! I built a few games, but all of them were too big.<p>Here&#x27;s a 2048&#x2F;Threes-clone in &lt;700 characters (or 5 tweets): <a href="https:&#x2F;&#x2F;twitter.com&#x2F;eigenbom&#x2F;status&#x2F;615424395192877056" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;eigenbom&#x2F;status&#x2F;615424395192877056</a>
pavel_lishin将近 10 年前
Cute; I didn&#x27;t realize that the element&#x27;s ID implicitly mapped it to a javascript variable in Chrome.
评论 #9803049 未加载
评论 #9802713 未加载
bigiain将近 10 年前
Was half expecting this to be:<p>curl <a href="http:&#x2F;&#x2F;www.hackerz-r-us.ru&#x2F;really_awesome_game.sh" rel="nofollow">http:&#x2F;&#x2F;www.hackerz-r-us.ru&#x2F;really_awesome_game.sh</a> | sudo bash #YouveBeenP0wnd
david-given将近 10 年前
One thing I&#x27;ve always meant to do was to put together a system for loading and saving Sinclair ZX81 games via Twitter messages.<p>Depending on how much you cheat, you can get about two bytes of data per Twitter character. That&#x27;d allow 256 bytes of game to live comfortably within a single twit, which is a quarter of an unexpanded ZX81 RAM. By comparison, that would take almost ten seconds to load off tape. You should be able to get a respectable ZX81 game in that.<p>With something like the JtyOne Javascript ZX81 emulator (<a href="http:&#x2F;&#x2F;www.zx81stuff.org.uk&#x2F;zx81&#x2F;jtyone.html" rel="nofollow">http:&#x2F;&#x2F;www.zx81stuff.org.uk&#x2F;zx81&#x2F;jtyone.html</a>) and some Twitter interaction, the whole process should be pretty seamless --- click on a twit to play; modify it using the ZX81&#x27;s built-in <i>cough</i> IDE; click on a button to reshare...
omgitstom将近 10 年前
And that kept my interest for about 140 seconds. Pretty damn good character:fun ratio. Bravo!
umeshunni将近 10 年前
If you&#x27;re interested in really small games, the smallest game is Chess written in 487 bytes of x86 machine code: <a href="http:&#x2F;&#x2F;www.pouet.net&#x2F;prod.php?which=64962" rel="nofollow">http:&#x2F;&#x2F;www.pouet.net&#x2F;prod.php?which=64962</a> Source code here: <a href="http:&#x2F;&#x2F;olivier.poudade.free.fr&#x2F;src&#x2F;BootChess.asm" rel="nofollow">http:&#x2F;&#x2F;olivier.poudade.free.fr&#x2F;src&#x2F;BootChess.asm</a>
fit2rule将近 10 年前
I&#x27;m not really a gamer, but I do love me some synth one-liners:<p><a href="http:&#x2F;&#x2F;countercomplex.blogspot.co.at&#x2F;2011&#x2F;10&#x2F;algorithmic-symphonies-from-one-line-of.html" rel="nofollow">http:&#x2F;&#x2F;countercomplex.blogspot.co.at&#x2F;2011&#x2F;10&#x2F;algorithmic-sym...</a><p>Most of these would also fit in a single tweet ..
评论 #9803715 未加载
wunderlust将近 10 年前
What exactly is happening here: &quot;a.style.margin=++s+e%300&quot;? (Specifically, the &quot;++&quot; part.)
评论 #9802784 未加载
评论 #9802787 未加载
评论 #9802778 未加载
评论 #9802773 未加载
评论 #9802777 未加载
lalwanivikas将近 10 年前
Reminds me of a game I made while learning to code:<p><a href="http:&#x2F;&#x2F;lalwanivikas.github.io&#x2F;window-game&#x2F;" rel="nofollow">http:&#x2F;&#x2F;lalwanivikas.github.io&#x2F;window-game&#x2F;</a><p>(Concept inspired from Jennifer Dewalt&#x27;s project, but code is entirely mine :))
DaveSapien将近 10 年前
Doesn&#x27;t actually fit in a tweet. 12 characters too long...am I missing something?
评论 #9808994 未加载
asgard1024将近 10 年前
Reminds me when my father showed me &quot;number guessing&quot; game on TI-57 calculator. It had 50 instructions (button presses) of memory. It&#x27;s interesting that the size wasn&#x27;t that a big deal then. :-)
dblotsky将近 10 年前
Totally exploiting the fact invalid HTML is accepted by modern browsers. :P
评论 #9802833 未加载
bartbes将近 10 年前
A few years ago I put a tiny game in a data uri in a QR code, unfortunately I lost the QR code, but I thought it was a neat concept.
naugtur将近 10 年前
Shorter version: &lt;p onclick=n=Date.now;id||(t=n(id=s=0));(e=n(++s)-t)&lt;2E4?style.margin=e%300:alert(s)&gt;X
the_duck将近 10 年前
This game makes me feel like a cat.
jakejake将近 10 年前
increments s before doing the rest of the calculation?
评论 #9803122 未加载