Live data from Hacker News

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

thad.frogley.info

91–100 of 154 posts

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

#91
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…

I strongly recommend playing with this sort of machine. It's an utter education. It will, literally, change the way you think about programming. Also, the ZX81 had the best cover art for any programming manual EVER:

http://uknet.com/gallery2/d/16341-2/076_Sinclair_ZX81_Manual...

(Paintings by John Harris. He sells prints! http://www.alisoneldred.com/thumbsJohnHarris-Prints-3-1.html)

However, you will be frustrated with the ZX81; the built in BASIC was utterly appalling and also didn't have a tokeniser --- instead each key (plus modifiers) produced a different keyword. And it was stateful, so the keys did different things depending on what you were typing. This made typing on it horribly frustrating even when you had the keywords written on the keyboard, which you won't have with an emulator.

It may be of interest to check out the Jupiter Ace --- it's basically the same machine, made by some ex-Sinclair staff, except running Forth instead of Basic; you can at least type on that, and using Forth means you're much closer to the machine. (Plus, Sinclair's Basic was seriously horrifying. Any alternative is better.) There's a bunch of emulators. But it's a much more esoteric machine, so there'll be very limited resources around.

There are Javascript emulators for all the above, but they're pretty naff.

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

#92
post #72

Earlier quoted context omitted.

Which is exactly why it isn't a good analogy. The amount wasn't arbitrary, it was the memory of the computer. There wasn't more to it being the 'greatest program' than the fact that it was created. There's no aesthetic judgement here. It is chess, with AI, in < 700 bytes.

Well, make it the greatest movie of all time because it was done with 1 $. He meant the "movie budget" could be arbitrary chosen to satisfy the "feat under huge constraints". Impressive but not necessarily deserving of the monicker: "best ever".

He meant the "movie budget" could be arbitrary chosen to satisfy the "feat under huge constraints".

Right, which is exactly why that isn't a good analogy to something where the budget was fixed, and the 'greatness' isn't an aesthetic judgement, but whether it can be done.

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

#93
post #86

Earlier quoted context omitted.

Weeeell... The entire point of computers is to be able to do work that would be too tedious for humans. Computers exist so people can be lazy. Making better programming languages so programmers can be lazy is kind of the whole point of the job.

The entire point of computers is to be able to do work that would be too tedious for humans. Really? News to me. Like the entire point of cars is to take you on journeys that would be too tedious to walk?

No, that's absolutely true. The first computers were for calculating logarithm tables, which were incredibly tedious, slow and error prone for humans to do.

If you're ever in Bletchley Park in the United Kingdom, go visit the National Museum of Computing. They'll show you (and you'll get to play with) the Harwell Witch, a decimal computer designed to compete with humans who are using mechanical hand-cranked calculators:

http://www.tnmoc.org/special-projects/harwell-dekatron-witch

A well-trained human can actually outperform the Witch; for twenty minutes. (They tried it.) But the Witch doesn't make mistakes and it doesn't get tired.

It was only much later that they realised that computers could do things which humans weren't _able_ to do.

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

#94
post #85
post #84

Earlier quoted context omitted.

The greatness of a run mile is measured by how fast it is run. The greatness of a movie is not measured by its budget, nor is the greatness of a program measured by its number of lines or memory footprint. Do you see now why your analogy is not as good?

Nope sorry. Do you see why your explanation is poor?

I can't imagine being like you, so please understand how weird it must be for me to watch someone be so dedicated to being wrong.

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

#95
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…

The smallest implementation of full chess is an irrelevant question. It all depends on the underlying machine and how the instructions are designed. At one extreme, a closed circuit with no programming interface but with the ability to play chess is a chess implementation with code size 0.

A legitimate and interesting question is what is the smallest possible chess implementation in a particular instruction set architecture such as x86.

A comparable example is writing quines (a program that outputs its own source code without reading itself from a file). It is a badge of honour to write the shortest quine in a particular programming language but comparing the length of a python quine implementation to a Java implementation is pretty meaningless.

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

#96
post #28

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't beat it every time (maybe not even half the time when I started playing against it).

I believed to have it too but I checked and I've got the Chess program from PSION instead, which is for the 16kB ZX81. I remember that I lost every single game. I keep it on the old CDs bookshelf, with a cassette of Defender. They're maybe the last two tapes left from those years. The ZX81 is somewhere at my parents house. I also kept the BASIC Programming Manual. I develop with Ruby and JS now, probably no less than 16 MB for any program I run :-)

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

#97

Wow, that'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) - http://mincss.com/ . In the same vein as this program, there's JS1k. Some of the stuff on there is also really amazing.

> Patients that switched from Bootstrap to Min reported up to a ninefold decrease in markup hehe. Actually though, as someone who learned CSS with the rule "Use Divs! No Tables!" What does a page with less divs even look like? What are the workhorses for page layout?

That rule is good. Using divs normally is fine. However, it is possible to overuse divs. Sometimes you'll have a div nested inside a div (and so on) six levels deep. That's considered bad.

For example,

is bad - you could reduce that to one or two divs at most.

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

#98
post #76
post #69

Earlier quoted context omitted.

"That raises the question of what is the smallest implementation of full chess?" Technically, that is a program that prints "I concede". If you also want it to play black (IIRC, this 1k chess doesn't) and validate moves, it would have to know the 20 opening moves for white and concede on black's first move. Of course, you could claim that isn't playing chess. But it is hard to define what, then, is chess. Picking a r…

The idea is that you have to actually implement all of the rules, even if your AI never invokes them. The game in this article for example, was originally designed as a two player game. If you can swap out the AI for a second human player and still play a correct game of chess, then you have 'full chess' now matter how bad the AI is.

I know, but would a program that implements all the rules, but plays lousy, qualify? If so, it seems more reasonable to ask people to write a language checker (does this series of moves constitute a valid chess game?) than a chess playing program, as, of example, it seems one should prefer a program that plays a lousy game of chess but never castles itself over one that plays an incredibly lousy game but actively uses all the rules.

And, but the way, "all the rules" can get quite complex if you consider the 50 move rule and draws by repeated positions, even more so if you pick a rule set from a time when the 50 move rule allowed for exceptions (http://en.m.wikipedia.org/wiki/Fifty-move_rule#History)

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

#99
post #70

Earlier quoted context omitted.

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…

I strongly recommend playing with this sort of machine. It's an utter education. It will, literally, change the way you think about programming. Also, the ZX81 had the best cover art for any programming manual EVER: http://uknet.com/gallery2/d/16341-2/076_Sinclair_ZX81_Manual... (Paintings by John Harris. He sells prints! http://www.alisoneldred.com/thumbsJohnHarris-Prints-3-1.html ) However, you will be frustrated w…

How did BASIC work with just 1k of memory? A scripting language interpreter is quite complex, not?

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

#100

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…

It didn't have to be a mirror image; it could also be an unmirrored copy. See, for example, the first screen of the second row of the map to Adventure:

http://www.vgmaps.com/Atlas/Atari2600/Adventure-Variation2.p...

Post reply on HN