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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

David Horne's 1K Chess on the ZX81 (2001)

380 点作者 jermo大约 10 年前

30 条评论

tzs大约 10 年前
Impressive, as is the recent smaller program from a French programmer.<p>Note, however, that both have sacrificed some rules. I believe they have both left out en passant, which is rare enough that it won&#x27;t be missed most of the time. It&#x27;s rare enough that if you use it against a casual player, there is a good chance they will accuse you of making it up.<p>Castling, however, which is also omitted, is much more serious. Getting castled is one of the top goals of the opening. It happens in nearly every game. Taking that out is huge.<p>Pawn promotion is missing from the older program but included in the smaller French program (making the French achievement even more impressive). I&#x27;d say that is not as big an omission as castling, because many games end before it gets to that point. Still, the threat of promotion has a major influence on endgame play.<p>So what we actually have are very impressive implementations of chess-like games. That raises the question of what is the smallest implementation of full chess?<p>I suspect that both these programs could be expanded to the full rules without making them a lot bigger, by taking the short cut of allowing the human to make those moves, but not the computer (especially if the computer trusts the human and does not check for legality of the human&#x27;s move). I think you could defend a claim that you then have full chess, and it is just a limitation of the AI that it does not consider those moves.
评论 #9153660 未加载
评论 #9153657 未加载
评论 #9153740 未加载
评论 #9155633 未加载
评论 #9154254 未加载
评论 #9155738 未加载
评论 #9153279 未加载
评论 #9154608 未加载
samatman大约 10 年前
Thanks to the Archive, the code and commentary is available:<p><a href="https://archive.org/stream/your-computer-magazine-1982-12/YourComputer_1982_12#page/n67/mode/2up" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;stream&#x2F;your-computer-magazine-1982-12&#x2F;Yo...</a> <a href="https://archive.org/stream/your-computer-magazine-1983-01/YourComputer_1983_01#page/n79/mode/2up" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;stream&#x2F;your-computer-magazine-1983-01&#x2F;Yo...</a>
评论 #9152541 未加载
VonGuard大约 10 年前
Just for the record, the Atari 2600 also had a chess game with AI. It also had only 1024 bits of RAM, but it had access to all of it because there was no OS or underlying hardware support, like in the Speccy. So while this is definitely amazing, the 2600 version is very close in the &quot;insanely well coded&quot; category, especially because the 2600 had some SERIOUSLY quirky hardware to deal with. For example, on the 2600, you could only draw half the screen&#x27;s background: the other side had to be a mirror image. Additionally, the columns of pixels that you drew on the screen were enumerated, to the halfway point on the screen as follows:<p>12345678,87654321,1234<p>So you were drawing forward, backward, then forward again, and that only got you half the screen!
评论 #9153307 未加载
评论 #9152602 未加载
评论 #9152319 未加载
评论 #9155695 未加载
评论 #9154340 未加载
评论 #9153065 未加载
StavrosK大约 10 年前
Why does the author say &quot;memory&quot; when he means &quot;disk space&quot;? Or does he actually mean &quot;memory&quot;, as in &quot;RAM&quot;? In that case, why would the size of the executable matter?
评论 #9151960 未加载
评论 #9151900 未加载
评论 #9151930 未加载
j2kun大约 10 年前
I&#x27;m not sure why the size of a program has any serious bearing on it&#x27;s greatness. Sure it&#x27;s an incredible feat of engineering, but shouldn&#x27;t the &quot;greatest program ever written&quot; be primarily judged by what it allows us to do, not need to do, to build, or what insights it provides?<p>For example, certainly the first widely used assembler was a &quot;greater&quot; program than any chess game, not only because it stopped us from having to track memory locations by hand, but because it allowed us to dedicate our brain cycles to actual problem solving and writing more useful programs.
评论 #9153443 未加载
评论 #9153275 未加载
评论 #9153381 未加载
jonjacky大约 10 年前
Also pertinent: Peter Jennings&#x27; Microchess for the 1K Kim-1. His page says it &quot;was the first game program sold for home computers&quot;, shipped in 1976.<p><a href="http://www.benlo.com/microchess/" rel="nofollow">http:&#x2F;&#x2F;www.benlo.com&#x2F;microchess&#x2F;</a>
评论 #9154151 未加载
评论 #9156129 未加载
desireco42大约 10 年前
Impressive, Elite game also comes to mind. For you who don&#x27;t remember, it was a really immersive game with huge universe that can fit on a floppy drive.<p>I remember when my friend show me proudly cd he just purchased with it, and didn&#x27;t believe game is small enough to not needing it. His face was precious when he opened cd and saw how big the game was.
GregBuchholz大约 10 年前
Olivier Poudade has recently written and even smaller version of the chess program, clocking in at 468 bytes:<p><a href="http://olivier.poudade.free.fr/" rel="nofollow">http:&#x2F;&#x2F;olivier.poudade.free.fr&#x2F;</a><p><a href="http://www.bbc.com/news/technology-31028787" rel="nofollow">http:&#x2F;&#x2F;www.bbc.com&#x2F;news&#x2F;technology-31028787</a>
评论 #9152502 未加载
illsorted大约 10 年前
Original source: <a href="http://www.kuro5hin.org/story/2001/8/10/12620/2164" rel="nofollow">http:&#x2F;&#x2F;www.kuro5hin.org&#x2F;story&#x2F;2001&#x2F;8&#x2F;10&#x2F;12620&#x2F;2164</a>
评论 #9152401 未加载
Supraperplex大约 10 年前
By the standards of the linked article I would say the greatest program is the original Elite game.<p>A whole universe complete with star systems and 3D models for spaceships plus some other content like missions... I think the name says it: elite.<p>All in 52 kb on disk.
评论 #9156714 未加载
评论 #9153304 未加载
评论 #9170134 未加载
owenversteeg大约 10 年前
Wow, that&#x27;s amazing. I love programs written in less than a kilobyte. Personally, I developed a CSS framework that is only 995 bytes (not to compare it to this program) - <a href="http://mincss.com/" rel="nofollow">http:&#x2F;&#x2F;mincss.com&#x2F;</a>.<p>In the same vein as this program, there&#x27;s JS1k. Some of the stuff on there is also really amazing.
评论 #9154004 未加载
bhz大约 10 年前
In homage to things like this, there are a number of 512 byte, 1k, etc. game development competitions. You can find them allover for a variety of machines. If you&#x27;re interested these tiny masterpieces, you should enter a competition, or at least check them out.<p>Years ago I made a 512 byte maze game, I put up the listing here: <a href="http://burninghorizon.com/pub/c64/tinyrinth/tinyrinth.htm" rel="nofollow">http:&#x2F;&#x2F;burninghorizon.com&#x2F;pub&#x2F;c64&#x2F;tinyrinth&#x2F;tinyrinth.htm</a><p>I made that page before I ever saw the article (and much later webpage) describing this 1k chess program. The article should enlighten anyone who isn&#x27;t sure just how small 1k of code actually is: <a href="http://users.ox.ac.uk/~uzdm0006/scans/1kchess/" rel="nofollow">http:&#x2F;&#x2F;users.ox.ac.uk&#x2F;~uzdm0006&#x2F;scans&#x2F;1kchess&#x2F;</a>
anjc大约 10 年前
A lot of the comments here are depressing, showing no appreciation of computing history or engineering challenges.
ctdonath大约 10 年前
TL;DR - chess, in 1K RAM <i>including</i> video and OS memory space.
shubhamjain大约 10 年前
Amazing! it is hard to imagine to even barely scratch the surface with constraints like that. Sinclair ZX81 does seem to have an emulator[1], would it be possible to see it run? It seems the emulator would need a assembled binary, something I am not sure would be possible without whole lot of grunt work.<p>[1]: <a href="http://www.chuntey.com/" rel="nofollow">http:&#x2F;&#x2F;www.chuntey.com&#x2F;</a>
brownbat大约 10 年前
Olivier Poudade&#x27;s BootChess claims to be the new record holder, 487-bytes of assembly: <a href="http://mashable.com/2015/01/30/play-it-better-tiny-chess-game/" rel="nofollow">http:&#x2F;&#x2F;mashable.com&#x2F;2015&#x2F;01&#x2F;30&#x2F;play-it-better-tiny-chess-gam...</a>
评论 #9152658 未加载
3327大约 10 年前
Holy smokes... blown away. 1K RAM? less then most email&#x27;s we write... Now&#x27;a days rockstars and Ninja&#x27;s are the glorified ruby guys who &quot;seemingly&quot; do Ruby&#x2F;django magic... This is what counts...This is the real deal...
评论 #9152240 未加载
评论 #9152112 未加载
评论 #9152537 未加载
评论 #9152139 未加载
jpalomaki大约 10 年前
A bit related: David Braben&#x27;s presentation about the original Elite.<p><a href="http://www.gdcvault.com/play/1014628/Classic-Game-Postmortem" rel="nofollow">http:&#x2F;&#x2F;www.gdcvault.com&#x2F;play&#x2F;1014628&#x2F;Classic-Game-Postmortem</a>
tibbon大约 10 年前
Link to the code: <a href="http://users.ox.ac.uk/~uzdm0006/scans/1kchess/" rel="nofollow">http:&#x2F;&#x2F;users.ox.ac.uk&#x2F;~uzdm0006&#x2F;scans&#x2F;1kchess&#x2F;</a>
atlantic大约 10 年前
And here are the rules that formed the core of the AI (in case you missed them):<p>Score provides a move score based on the following: first, the &quot;To&quot; position results in taking of a piece. Second, the &quot;From&quot; position is attacked. Third, the &quot;To&quot; position is attacked. Fourth, &quot;To&quot; enables the computer to obtain a check and finally the &quot;From&quot; position is defended.
brudgers大约 10 年前
The other day, my son brought a discarded 3.5&quot; floppy from PrintShop home from school. It got me thinking about the fact that 1440kb or even 720kb is more information than a person can wrap their head around unless it&#x27;s dumbed down to a simply interpreted bitmap...i.e. we can interpret it with our visual cortex.<p>1024 bytes has 2^8192 permutations. And 3-SAT is NP-Complete.
angularly大约 10 年前
Nice! ZX81 was my first computer. I didn&#x27;t even have the tape storage. I just typed some program in from a magazine and left it on for a couple of days. I even got the Lampda 16K memory expansion, which was a big external module mounted on the back :)
smoyer大约 10 年前
I have that program! The cassette it came on is still in my basement (along with a couple of ZX-81s and TS-2000s). While it might be rudimentary AI, I also didn&#x27;t beat it every time (maybe not even half the time when I started playing against it).
评论 #9154258 未加载
vanderZwan大约 10 年前
Given that the TI-8X series of calculators run on a z80 chip, we could port this almost as-is to that little machine, right?<p><a href="http://en.wikipedia.org/wiki/TI-84_Plus_series" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;TI-84_Plus_series</a>
henrik_w大约 10 年前
Kevlin Henney mentions this program in his talk &quot;Cool Code&quot;. The whole talk is really worth watching.<p><a href="http://www.infoq.com/presentations/Cool-Code" rel="nofollow">http:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;Cool-Code</a>
ddorian43大约 10 年前
See kkrieger. 96KB doom3-like fps-demo
DodgyEggplant大约 10 年前
For the record, drawing on screen was poking bytes directly to the screen memory.
Fastidious大约 10 年前
Does anyone have a link to find out more about David Horne?
评论 #9154934 未加载
stillsut大约 10 年前
This is the opposite of a great program.<p>A great program scales with Moore&#x27;s Law: when you get 2x memory, the program gets better, ideally more than 2x better.<p>Human limitations remain constant through the ages, that&#x27;s why climbing Mt. Everest or the 4 minute mile are so compelling. But the most basic fact about computing capacity is its (exponential) upward trend.
luma大约 10 年前
If you can&#x27;t castle, you can&#x27;t promote a pawn, and you can&#x27;t en passant, it isn&#x27;t chess.
评论 #9152108 未加载
评论 #9151987 未加载