Live data from Hacker News

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

thad.frogley.info

131–140 of 154 posts

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

#131
post #37

Impressive, as is the recent smaller program from a French programmer. Note, however, that both have sacrificed some rules. I believe they have both left out en passant, which is rare enough that it won't be missed most of the time. It'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. Castling, however, which is also omitted, is much more serious. G…

> 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

Ah, but, for instance, what if the only remaining move for the AI was to use the en passant rule, for instance? By not invoking the rule, the AI would not be playing chess by the book.

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

#132

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 "insanely well coded" category, especially because the 2600 had some SERIOUSLY quirky hardware to deal with. For example, on the 2600, y…

The 2600 hardware is certainly quite... unique, but that didn't stop the demoscene (I'm surprised at no mention of the demoscene in the comments until this post) from doing some rather impressive things with it; here is a memorable recent example of that:

http://www.pouet.net/prod.php?which=64492

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

#133
post #37

Impressive, as is the recent smaller program from a French programmer. Note, however, that both have sacrificed some rules. I believe they have both left out en passant, which is rare enough that it won't be missed most of the time. It'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. Castling, however, which is also omitted, is much more serious. G…

That raises the question of what is the smallest implementation of full chess?

In terms of source code, probably Toledo Nanochess:

http://en.wikipedia.org/wiki/Toledo_Nanochess

However, that ~1k of source becomes closer to ~2.5k of binary (x86, Windows 32-bit.)

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

#134
post #79

Earlier quoted context omitted.

I think it's helpful to consider that this program in 672 bytes of machine code rather than source code or assembler. That helps the comparisons to English text seem a little less jarring: if my words were expressed as 8bit bytes rather than a series of byte sized chars you'd see a lot of compression in my communication. He also 'cheats' a bit by keeping part of the program on tape and never loading it into memory so…

Even zipped your comment is still 867 bytes. It would be difficult to even explain the castling rule alone in English text in 672 bytes.

castling:req K&R 1st rank,never moved,no pieces between;can't castle out of,through,or into check;single move:Ke>g&Rh>f or Ke>c&Ra>d

134 bytes, not compressed. Did I miss anything?

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

#135
post #37

Impressive, as is the recent smaller program from a French programmer. Note, however, that both have sacrificed some rules. I believe they have both left out en passant, which is rare enough that it won't be missed most of the time. It'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. Castling, however, which is also omitted, is much more serious. G…

That raises the question of what is the smallest implementation of full chess? In terms of source code, probably Toledo Nanochess: http://en.wikipedia.org/wiki/Toledo_Nanochess However, that ~1k of source becomes closer to ~2.5k of binary (x86, Windows 32-bit.)

oh, with my latest chess programming language, the source code for chess is 0 bytes. feed an empty file to the chess compiler and out comes a working binary which plays chess.

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

#136
post #70
post #37

Impressive, as is the recent smaller program from a French programmer. Note, however, that both have sacrificed some rules. I believe they have both left out en passant, which is rare enough that it won't be missed most of the time. It'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. Castling, however, which is also omitted, is much more serious. G…

There's a rather ahistoric perspective at work here. I wonder if there's a generational thing. ZX81 chess was so impressive because it was impossible (at least, I'd have bet real money on it). It was the thing programmers namechecked as the kind of thing you couldn't do on these newfangled cheap home computers. You need a 'real' computer to do it. There's just no way. I was writing programs for the ZX81, and the kind…

> It was the thing programmers namechecked as the kind of thing you couldn't do on these newfangled cheap home computers. You need a 'real' computer to do it.

When I first read the Jargon File in '96 or so, I remember being uncharacteristically annoyed by its terse, dismissive attitude towards affordable home computers ("bitty boxes"). That particular sort of elitism seemed very much at odds with the challenge-loving, egalitarian hacker spirit that the rest of the document extols. One could argue that ESR was just faithfully documenting the usage at the time, but he frequently editorializes in other entries; I think one can assume that he didn't disagree, which was a bit disappointing.

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

#137
post #89
post #79

Earlier quoted context omitted.

I think it's helpful to consider that this program in 672 bytes of machine code rather than source code or assembler. That helps the comparisons to English text seem a little less jarring: if my words were expressed as 8bit bytes rather than a series of byte sized chars you'd see a lot of compression in my communication. He also 'cheats' a bit by keeping part of the program on tape and never loading it into memory so…

There are 4.7 bits per character for Latin text, which means the comment would have 853 bytes of uncompressed information. Estimates of information density for English are as low as 1.5 bits per character, giving 272 bytes in that comment. The information density in machine code isn't 1 bits per bit though, because of the distribution of which opcodes are used, so the 672 would also drop. So I think the analogy is a…

> Estimates of information density for English are as low as 1.5 bits per character

Can you expand on that?

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

#138
post #90

Earlier quoted context omitted.

What do you mean? The program really plays chess against the user by running in the 1K RAM of the computer that is designed to spend 768 bytes of the said 1K just for the screen content. http://en.wikipedia.org/wiki/ZX81 24 lines of 32 characters. 768 bytes usually cleared and scrolled away as you type. The user just has to load the cassette and play. Even if the program was developed on the Cray (it was not) everyth…

"the computer that is designed to spend 768 bytes of the said 1K just for the screen content." No, it was designed to use up to 793 bytes (those 768 plus one byte for every line plus, it seems, one extra 'end of screen' byte) for the screen buffer. If you didn't write stuff, the size of the screen buffer was way smaller, down to 25 bytes for an empty screen ( http://problemkaputt.de/zxdocs.htm#zx80zx81videomodetextan…

Thanks for explaining the details of the screen handling of ZX81. Still the author of Chess1K managed to use even the bytes of the "used" display lines for his calculations, and that it's still undisputed that the 600-something bytes are really the whole thing the user needed to run the program.

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

#139

Also pertinent: Peter Jennings' Microchess for the 1K Kim-1. His page says it "was the first game program sold for home computers", shipped in 1976. http://www.benlo.com/microchess/

I put a bit of effort into that, basically making C macros to emulate 6502 assembly and getting the program to run on modern machines that way. Peter gives me credit on his site. I often think it would be a good idea to load up his machine code on a 6502 emulator and try to round trip confirm the accuracy of my translation, but time, as always is the enemy.
Post reply on HN