Originally published at: https://boingboing.net/2019/04/22/1981s-1k-sinclair-chess-vs-a.html
…
That was great, channel looks pretty interesting as well
In 1k it’s impressive just to program the legal moves. You want strategy too?
I don’t remember which chess program I had on my Sinclair, but then I only played it once. Somehow I managed to capture the program’s king yet the game kept going for several moves, until the king magically reappeared on the board.
I called it a draw and never went back.
I wonder how it would fare against this:
Fit on one low density 5.25" floppy so less than 360k.
I beat the game once, after putting it on its lowest level, turning off its opening book, and crippling some other basic component in the settings.
Hmmm. I wonder if that was how it was beating the modern app…
It has a ZX Spectrum 48K version (the Spectrum is backwards compatible with the ZX81), so it uses less than 48k RAM.
I had the same game. I edited the game files to make it say bizarre, inhuman things.
That’s quite a trick to get it to fit in 1k.
My brother wrote a 4k chess program for our homebrew 6800 computer in 1978, which I thought was a feat. His had similar performance to this 1k chess, although I think that his had one play lookahead.
The source code is here
http://users.ox.ac.uk/~uzdm0006/scans/1kchess/
I wonder if anyone improved it while staying within the 1K limit
Watch this:
artificial stupidity relying on search versus artificial intelligence of 1984 relying on knowledge.
today we have 2019. thats 35 years of computerchess development.
both 1000 NPMOVE
Mephisto III S was running on a 68000 with 12 Mhz and made 3-5 NPS.
Stockfish 10 limited to 1000 Nodes per move.
mephisto III was developed by thomas nitsche and Elmar Henne and was an attempt of A.I.
It should made very few NPS like a human beeing and still made good moves.
it had 64 KB rom and 16 KB ram. it was 16 Bit and had no hash.
it has an 8 bit brother having 32 KB rom and 8 kb ram doing arround 1-3 NPS.
mephisto III got Level 6 = 40/120 time control.
Stockfish 10 had arena and 1000 Nodes per move.
mephisto III doing arround 3 searches. stockfish arround 7/8 searches.
here the 1st game:
[Event "Computer Schach Partie"]
[Site "ORION8"]
[Date "2019.04.05"]
[Round "?"]
[White "Mephisto III S Glasgow"]
[Black "Stockfish_10_x64_popcnt"]
[Result "1:0"]
[ECO "B22"]
[Opening "Sizilianisch (Alapin 2.c3), 2...Nf6 3.e5 Nd5 4.d4 cxd4 5.Nf3 Nc6 6.Bc4"]
[Time "21:53:52"]
[Variation "(Alapin 2.c3), 2...Nf6 3.e5 Nd5 4.d4"]
[WhiteElo "2400"]
[Termination "normal"]
[PlyCount "50"]
[WhiteType "human"]
[BlackType "program"]
1. e4 c5 2. c3 Nf6 3. e5 Nd5 4. d4 cxd4 5. Qxd4 Nc7 {-1.63/7 0} 6. Bc4 b5
{+0.78/7 0} 7. Bb3 e6 {-0.69/7 0} 8. Nf3 Nc6 {-1.46/6 0} 9. Qe4 h6 {-0.17/6
0} 10. O-O a5 {-0.82/6 0} 11. a4 b4 {-1.43/6 0} 12. Rd1 bxc3 {+0.31/7 0}
13. Nxc3 Rb8 {-1.11/6 0} 14. Bc4 Ba6 {-1.95/6 0} 15. Bxa6 Nxa6 {-1.79/7 0}
16. Qe2 Nc5 {-0.12/7 0} 17. Be3 Nb3 {-0.94/7 0} 18. Rab1 Rb4 {-1.25/7 0}
19. Qc2 Be7 {-0.57/7 0} 20. Nb5 O-O {+0.54/6 0} 21. Rd3 Rxa4 {-3.05/6 0}
22. Rxb3 Nb4 {-2.87/6 0} 23. Qe4 Qb8 {-4.78/6 0} 24. Nc3 d5 {-9.62/6 0} 25.
exd6 Qxd6 {-9.38/7 0 Schwarz gibt auf} 1:0
where is the progress ?
the progress mainly relies on hardware.
when in 1984 Mepihsto III S made arround 3-5 NPS the opponent Brute Force engines such
as kittingers Constellations and SuperConstellations did arround 1.500 NPS vs. 3-5 NPS.
today on a slow PC stockfish 10 does arround millions of NPS. lets say 3.000.000 NPS.
so the factor between 6502 4 mhz from 1984 and todays i7 is nearly 2000 !!!
but still Mephisto III S with its artificial intelligence wins the race.
I feel picky today…
Nope. The Spectrum is the successor of the ZX81 and they share a lot of similarities (same CPU, same style of keyboard layout, etc.), but they are not compatible. The 1K chess game would not run as-is on a Spectrum.
Thanks for the correction. It looks like my source was wrong.
ETA: I originally searched to see if the Spectrum was backwards compatible, and got nothing except one page that seemed to suggest it was hardware compatible. I think they meant it had an emulator, like @word_soup says.
I think there was an emulator for 128k Spectrums that ran ZX81 games & I’ve seen the ZX81 version of Manic Miner running on an emulated Spectrum (on a Dreamcast), but I haven’t tried it on a real Spectrum & can’t find a link to the emulator atm.
I wonder how much chess could be stuffed in somehow?
BootChess seems like the best, it’s only 512 bytes. It’s an implementation of ZX Chess (textmode, no castling) though.
I think a good challenge would be “1K chess” but make it symbolic. The engine, board and rules are free so what you’re spending your 1K on is only strategy.
Maybe “they” could even develop a “Chessembly” notation to make the process of turning chess logic into assembly more accessible. Or to at least put everyone on a level playing field, so the budget can be abstract rather than technical (rather like how the ZX81 stored BASIC commands as single-byte keywords!)
Hence this traditional proclamation: “The King is dead. Long Live the King.”
I had Cyrus Chess for the 48K Speccie.
It supposedly held its own against a Cray Blitz, whatever that was. It seemed pretty challenging to me.
Before Game of Thrones was the game of “Lords of Midnight” (ZX 48K), which showed an impressive feat of memory shoehorning. A first person strategy of fantasy armies played on a board of over 4000 (64 x 64) locations. Game play may not have been the most brilliant, but looking out of your keep at dawn to see the Night King’s armies spread across the plains below could produce a bit of an adrenalin surge .
A thousand bytes of assembler is a lot of code. I think the most I ever wrote for the 6502 was a couple of hundred bytes. I have no trouble believing that the basic logic of chess could be packed into that space. It probably had a couple of hundred bytes for working data anyway.
Cool program.
I’ve recently been tinkering with a version of MicroChess, which was written by Peter Jennings for the KIM-1 computer, and was also limited to 1K of machine code (for the 6502 in this case).
In 2005 the source code was ported to C. Not a rewrite; rather, a 6502 emulator was created to support the original 6502 Assembly code, which was converted to C macro invocations and function calls. (Downloadable from Jennings’ site: http://www.benlo.com/microchess/index.html)
The C version does not compile down to only 1K, but the Assembly-as-C trick is quite clever.