ChesSkelet: Micro Chess Game for ZX Spectrum in 365 Bytes
chesskelet.x10host.com
chesskelet.x10host.com
First thing: maximum respect for earlier implementations, especially 70s and 80s ones, which seem to me much more difficult to complete with the resources of that time. And for 1K programs like Toledo's, I´m fully aware it would smash my code, but I´m not trying to do something playing well, you ave tons of good playing programs.
If you allow me, let me give you my opinion on the "full set of rules" discussion. First of all, let me warn you that none of the 1K implementations fulfills a full set of rules, be it Nanochess or any other. Long term draw situations, some stale mates and others require much more development.
This said, probably the discussion is: how much can we trim the rules and still call it chess? My pieces are letters and the board is dots! That discards my program before moving any piece. Now, I agree that missing castling is a bad one and I intend to add it to the "full" version later on. The funny thing about castling is that I only need to allow the human side to do it. With such small AI on the computer side, it would never know when it shall use it. For the other rules most people can live without en-passant or under-promotions for this type of informal playing.
You still think it cannot be called chess? Well, I respect it but other people are not so worried about FIDE compliance and enjoy moving letters versus a 300 byte program.
Also, I already got feedback that allowed my to reduce code by 12 bytes, so if anybody feels like digging into the assembly I'm sure it can be shrunk a bit.
Alex
(deterministic responses from computer in []s)
1. e2e4 [e7e6]
2. e4e5 [d8h4]
3. g2g3 [h4d4]
4. c2c3 [d4e5]
5. d2d4 [CRASH]
(v 0.703)It is not a naive prototype. I'd be very surprised if the programmer couldn't play chess. It's a part of computing history. And the competition to reduce the number of bytes is > 35 years old.
Was tempted to capture the king with my knight, closed browser window instead :)
This isn't a Basic program, does it just use that string to save embedding text, or does it actually use Basic for some things?
I stumbled over what to call it too.
I should add I have only basic experience in both ZX machines. I was a kid at the time and just learning, so my memory may be dubious. But yes that's basically my understanding.
People at the time just called it "ROM or "ROM routines". There's the BASIC interpreter, but there's also a lot of useful functions you can call from assembly (like the ROM tape loader for example).
> it just blows the call stack
It seems to me this is an unintended side effect. The game code is entered using USR, which is the BASIC expression to call into assembly code [1]. A normal "ret" opcode should just return to the prompt, but apparently the game messes up some internal BASIC interpreter state, which results in this error upon return.
[1] http://www.worldofspectrum.org/ZXBasicManual/zxmanchap26.htm...