Chess game in 487 bytes – new record
pouet.net
pouet.net
It's a weird kind of 3rd way, it's not open source, it's free as in beer, there's tons of help/guides/talks available, but source is rarely made available due to the competitive nature of the scene. Demogroups (or members of groups) frequently end up in the commercial world and it's been C64->Amiga->DOS->Windows for the most part, almost completely skipping Linux, OS X and other x-nix derived platforms (though there are plenty of exceptions). It's unusually prolific, there are literally tens of thousand of pieces of software and at least a half million pieces of music produced by the scene...and it's almost entirely purposeless with scant few connections to the commercial world.
The result is frequently stunning technology and art (and sometimes technology that's so elegant it's basically art on its own), splinter scenes and a constant showcase of real-time techniques that continue to push what even grizzled computing veterans think is possible.
And oh yeah, it's mostly populated by people young enough to have not even graduated college.
> Well... It is clear to me that you put more interest in making a small chess program that in making a good chess program. That's understandable even if the result is a program very easy to beat but... you cannot say that BootChess is a complete chess program because it does not allow to castle (didn't tried promotions, underpromotions, en passant pawn captures, stalemate... but I bet that are not supported, are they?) and, worst, it does not care about avoid to place a King in check. Every chess player knows that it is illegal (the movement CANNOT be made) to place your king on a square controlled by your rival pieces. If you allow it, then this is not chess.
That's pretty much obvious
It's an exercise in programming, it's not "the ultimate chess software"
It still looks like an impressive exercise, but any talk of broken records demands widely accepted set of rules that have been met.
I agree that it would be nicer if the implementation followed FIDE rules, though, and that not being able to castle significantly changes the strategy.
- should be able to play with both white and black
- support all normal moves obviously
- must allow opponent to play any legal move (castling, en passant, promote pawn to any figure)
- must not keep its own king in check
An interesting challenge would be to see if you can add all the missing rules and still keep it under 1k. So the lovers of strict definitions would finally have their version!
(That's a long way to say that the question is somewhat under-constrained.)
Instead consider a CPU architecture and accompanying notation designed especially for playing chess. The other idea is not very interesting.
Assuming some arbitrary architecture plus the necessary code to emulate it on a normal architecture (including your stupid CHS example) would normalize the "size" of the program, anyway -- unless there are hardware structures that are especially good for chess. Which was the essence of the question.
As someone said on proggit, this claim is similar to claiming to be the fastest 100m runner, except you ran 70 yards.
There should be an ongoing challenge to implement a full chess rule spec in as small a program as possible.
FIDE rulebook(warts and all) is one place to start: http://www.fide.com/component/handbook/?id=124&view=article
Also, there is a 50-moves rule and 3rd position repetition rule, but I believe this doesn't need to be implemented, since you are not required to invoke the rule.
Or do you mean the ai can't castle, but you can?
The title claims it can play chess, this is not chess.
I think that problem requires at least as much space as the brain module that determines "usefulness", which means quite a lot of space.
Also, because the ZX81 more-or-less did its video in software (again, it's more complicated than that; if you really want to know, you'll need a strong stomach. Let's just say that it hinged on abusing the Z80's built in DRAM refresh and the framebuffer was executable), which meant that the only time you could do processing with the screen turned on when it wasn't doing video. And the video took 75% of the run time.
The ZX81 was less a computer and more of a pile of hacks flying in close formation. The fact it ran at all was a miracle.
http://www.user.dccnet.com/wrigter/index_files/ZX%20Video%20...
Note the encoding of that page causes it to render incorrectly at least in Firefox. Using View → Character Encoding → Western fixes that for me.
For info the author also released an impressive serie of very tiny intros ranging from 64 to 256 bytes which can be found on his personal site : http://olivier.poudade.free.fr
However there is a nice txt file, Bootchess.txt that has some interesting excerpts. I was curious if it has an AI, to which it does:
" Usually the heart of any midly advanced computer chess games includes a MinMax function (or its unique call merging sister function NegaMax) called recursively evaluating both sides' possible moves and trying to minimize loss whilst maximizing captures : each evaluation pair rundown is called a "ply" in chess jargon. It can take Kasparov some 27 moves to battle a 3-ply and the champion programs competing with grandmasters usually have at least 5-ply. In the case of BootChess there is alas not enough space (512 bytes binary program size and 640 bytes RAM execution environment) for such level of sophistication. It uses a variant : while maximizing captures it tries to minimize the taxi/Manhattan distance to the opponent's black king rank. This weaker ai element combination will be named "TaxiMax" for the occasion and can be viewed as a half-ply plus."
Easy way to get them smaller and be legitimate chess (This seems to be missing half the rules) would be let white move, then resign. You might have to allow white to resign / offer a draw as a move as well.