5 ms·
1K ZX Chess
- spacehome 8y agoIt's hard to reconcile this: > It was the smallest implementation of chess on any computer until its record was broken in January 2015 by the PC-compatible BootChess. with this: > 1K ZX Chess uses only 672 bytes of RAM,[2] but implements chess rules except for castling, promotion, and en passant, including a computer opponent. If you don't include castling, promotion, and en passant, the game isn't chess anymore, or at least it hasn't been for a couple hundred years.
- lifeisstillgood 8y agoBut ... that's like moaning that Bannister broke the four minute mile but collapsed at the finish line. 1K is a hellava achievement
- spacehome 8y agoNonsense. Bannister ran a mile. I've made lots of programs that were under 1K. They weren't chess, either.
- jermaustin1 8y agoI don't like how negative this comment is, but the logic is flawless. I have also made a lot of "<1K not-chess" games.
- mikeash 8y agoIt would be more like moaning that he broke the four minute mile but collapsed fifty feet before the finish line. Should it be counted if you didn’t finish? This program is awesome, but it’s not quite chess.
- pmden 8y agoI believe boot chess also does not implement two of those three, which makes it a fine comparison. Promotion is something I expect most people know, castling is something they might know, but en passant is hardly common. I wouldn't be at all surprised if the number of people who play chess without knowing that rule exceed those who play by FIDE rules. Whatever the case, it is still a variant of chess, so I see no problem calling it chess.
- spacehome 8y agoEn passant comes up a lot more often when you don't know the rule.
- umanwizard 8y agoPromotion shouldn't be compared to castling/en-passant here. A game without castling or en passant would be similar enough in spirit that we could call it a "chess variant". Removing promotion, on the other hand, would result in a wildly different game. I actually suspect it'd be impossible to win against any non-beginners, making it more similar to tic-tac-toe than to chess.
- deleted 8y ago[deleted]
- aj7 8y agoA chess program without castling, promotion, and en passant is incomplete. It is not chess, it is a work in process.
- deleted 8y ago[deleted]
- bdz 8y agoSource code http://users.ox.ac.uk/~uzdm0006/scans/1kchess/ http://users.ox.ac.uk/~uzdm0006/scans/1kchess/ Actually it's the 3rd part of the full series, makes more sense with the previous articles 1st https://archive.org/stream/your-computer-magazine-1982-12/YourComputer_1982_12#page/n67/mode/2up https://archive.org/stream/your-computer-magazine-1982-12/Yo... 2nd https://archive.org/stream/your-computer-magazine-1983-01/YourComputer_1983_01#page/n79/mode/2up https://archive.org/stream/your-computer-magazine-1983-01/Yo... 3rd https://archive.org/stream/YourComputer_198302/YourComputer8302#page/n99/mode/2up https://archive.org/stream/YourComputer_198302/YourComputer8...
- schoen 8y agoSee also http://nanochess.org/chess4.html http://nanochess.org/chess4.html (discussions and links to 2K and 1K Javascript implementations). "Take note that the 1018 octets of my Javascript code include an artificial intelligence and also the user's interface and chessboard visualization"
- antirez 8y ago> It was the smallest implementation of chess on any computer until its record was broken in January 2015 by the PC-compatible BootChess.[4] It would be interesting to compare x86 and Z80 code density, that is, how much you can do per bit of machine code.
- flohofwoe 8y agoNot a 'scientific' comparison, but handwritten 8-bit machine code compresses much less than x86/64 machine code (using gzip --best): - a compiled C executable for x86/64 compresses to about 38% of its original size (199 KB down to 77 KB) - a WASM blob of the same code compresses to about 32% (171 KB down to 56 KByte) In comparison some 8-bit ROMs: - ZX Spectrum 128 ROM (Z80): 16384 bytes compresses to 12189 (74.3%) - C64 Kernel ROM (6502): 8192 bytes compresses to 6735 (82.2%) So 8-bit code seems to be a lot 'denser' than today's machine code, and 6502 is denser than Z80 :)
- schoen 8y agoThat's interesting! Do you think this is because 64-bit code simply doesn't use a lot of its instruction set space (where more opcodes and instruction modes and variants are undefined and therefore not routinely used in executables), or because some of the people hand-writing 8-bit assembly actively use more opcodes than a typical compiler would, or some other factors? Or are there are a lot of pointers in 64-bit code that contain a huge number of zeroes? :-)
- flohofwoe 8y agoI guess it's a combination of compiled vs handwritten code (maybe certain patterns show up more often in compiled code, while handwritten 8-bit code tries hard to remove any redundancies because of the limited available space), and bigger data types (especially 64-bit pointers).
- antirez 8y agoVery interesting! Another thing to consider however is how much work each instruction can do. In that regard x86 may have a big edge.
- classichasclass 8y agoMicrochess on the KIM-1 says hi. ZX Chess is still smaller, and actually has a display, but this wasn't a lot bigger and appeared on other 6502-based systems. https://www.floodgap.com/retrobits/ckb/secret/microchess.html https://www.floodgap.com/retrobits/ckb/secret/microchess.htm...
- pmontra 8y agoThere was Psion Chess for the expanded ZX81 (16 KB RAM.) I still have the cassette. The instructions on the cover explain how to castle and state that it recognize en passant. No mention about promotions but they should be supported. Load time "3.5 mins approx." I remember that I lost every signore game against it but it wasn't very fun because it used fast mode and I couldn't see the screen when it was thinking.
- m1el 8y agoThere's also an implementation of chess in 1K of JS: https://js1k.com/2010-first/demo/750 https://js1k.com/2010-first/demo/750