mephisto wrote: ↑Mon Jun 28, 2021 2:12 pm
This is what the creator of the JavaScript Sargon said and this is why it is not the same.
So, I've decided to find interesting things in this old assembler code and recreate some parts of it sort of modern way. Here is the result - jsSargon that runs in browser's canvas. Of course, it's kinda fake and nothing more.
A bit disappointing, but hopefully there's at least some similarity with playing style.
If you can't get gold, there's always brass - link.
Human chess is partly about tactics and strategy, but mostly about memory
It's been a few years since I first got Sargon 1978 running as a Windows UCI engine. Somehow I still felt there was some unfinished business with that project and a while ago (a year ago actually - a disturbingly long time) I sat down and decided to fix that.
Basically to cut a long story short I've converted the Sargon 1978 Z80 code to C++, as opposed to my original project where I converted it to 32 bit x86 assembly language. I've called my new project Zargon https://github.com/billforsternz/zargon.
What is the point of this? Well no point really, it's a very impractical project, I've just been scratching an itch. There are some benefits though, and it might be of interest to someone, especially someone who is interested in old chess software so here I am posting again on Talkchess (or Computer Chess Club).
The benefits are;
The code runs 3 times faster. This was kind of suprising, assembly is supposed to be faster than anything right? Well not really, the 32 bit assembly version of Sargon was a bit restricted, converting it to C (well, C++) allowed me to unleash some shackles.
The code is more accessible to hobbyists. It can now be readily ported to any platform with minimum fuss.
I finally understand the Spracklens' code! I managed to get it working before without *really* understanding how it works. Those days are over. With a native C++ version available I built an instrumentation harness and was able to dig into the inner workings to my heart's content. That revealed all the secrets and I documented my findings in the project.
I simplified the project but also enhanced it. It's now renders to just one Windows .exe which *is* a UCI engine but also includes the original test harness and a new fun feature - a standalone console with ascii art graphics for an old school chess computer experience.
I found and fixed an important bug in the Spracklen's original Z80 code. For now the information about that is only accessible by digging into the git history looking for ATKSAV_BUG, but before too long I will document that in more accessible form. This should make this new version of Sargon UCI a little stronger (the bug would occasionally cause nonsensical, more or less random moves).
I post this here in the hope that it will find some interest. The github project page I linked above has more information, and of course you can download the Windows executable from the release page there.
Bill Forster wrote: ↑Wed Dec 02, 2026 5:56 am
It's been a few years since I first got Sargon 1978 running as a Windows UCI engine. Somehow I still felt there was some unfinished business with that project and a while ago (a year ago actually - a disturbingly long time) I sat down and decided to fix that.
Basically to cut a long story short I've converted the Sargon 1978 Z80 code to C++, as opposed to my original project where I converted it to 32 bit x86 assembly language. I've called my new project Zargon https://github.com/billforsternz/zargon.
What is the point of this? Well no point really, it's a very impractical project, I've just been scratching an itch. There are some benefits though, and it might be of interest to someone, especially someone who is interested in old chess software so here I am posting again on Talkchess (or Computer Chess Club).
The benefits are;
The code runs 3 times faster. This was kind of suprising, assembly is supposed to be faster than anything right? Well not really, the 32 bit assembly version of Sargon was a bit restricted, converting it to C (well, C++) allowed me to unleash some shackles.
The code is more accessible to hobbyists. It can now be readily ported to any platform with minimum fuss.
I finally understand the Spracklens' code! I managed to get it working before without *really* understanding how it works. Those days are over. With a native C++ version available I built an instrumentation harness and was able to dig into the inner workings to my heart's content. That revealed all the secrets and I documented my findings in the project.
I simplified the project but also enhanced it. It's now renders to just one Windows .exe which *is* a UCI engine but also includes the original test harness and a new fun feature - a standalone console with ascii art graphics for an old school chess computer experience.
I found and fixed an important bug in the Spracklen's original Z80 code. For now the information about that is only accessible by digging into the git history looking for ATKSAV_BUG, but before too long I will document that in more accessible form. This should make this new version of Sargon UCI a little stronger (the bug would occasionally cause nonsensical, more or less random moves).
I post this here in the hope that it will find some interest. The github project page I linked above has more information, and of course you can download the Windows executable from the release page there.
Thank You Bill. I just finished build on Linux look forward to taking it out for a spin.
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
Great to see this finished! Sargon was one of the first chess programs I ever heard about, and there's something charming about a 1978 engine sitting in a modern GUI. Out of curiosity, does it actually get stronger with longer time controls, or does the original search depth cap it pretty quickly?
Retro Games Lib - retro console and arcade games in your browser
AdminX wrote: ↑Wed Dec 02, 2026 7:52 am
Thank You Bill. I just finished build on Linux look forward to taking it out for a spin.
Thanks for giving it a try! I remember you found an important bug the last time (Sargon) - I hope not this time (Zargon)!
I should really have found a Linux box (or a WSL session) and done at least a cursory test on Linux myself. Please let me know whether the interactive console (just run it in a terminal) works, not just the UCI engine.
Maya wrote: ↑Wed Dec 02, 2026 10:14 am
Great to see this finished! Sargon was one of the first chess programs I ever heard about, and there's something charming about a 1978 engine sitting in a modern GUI. Out of curiosity, does it actually get stronger with longer time controls, or does the original search depth cap it pretty quickly?
It certainly gets stronger, a lot stronger than it was in 1978. Good enough to be challenging for me (a weak CM) playing casually, probably 1600 or so. But with deadly tactics if you're not very careful. The difference is depth. In 1978 even depth 2 took more than a minute a move. A minute a move or so now is depth 7 (i.e. a full width 7 ply search). The 1978 version would take hours per move for depth 6 (so completely impractical) and it could not do depth 7 at all (probably at least a day per move, so judged not worth supporting then).
I hope someone will do some proper engine testing, as they did with my earlier Sargon project. I think Zargon will be usefully stronger, as the 3 times speed up will enable usefully deeper search on average. Especially as I've improved the UCI time management I think. And there's the important bug fix.
There's very little chess knowledge in Sargon, it's basically just tries to win material or board control if that's not possible. But this is sufficient for minimally decent chess at 6 or 7 ply search depth. Oh, and the search depth adaptively deepens as material is exchanged.
So far so good Bill, interactive shell and commands all appear to be working!
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
AdminX wrote: ↑Wed Dec 02, 2026 11:13 am
So far so good Bill, interactive shell and commands all appear to be working!
Nice! Thanks. I recommend 'big' command for better ascii art graphics, as long as you can stretch up the terminal. Remember that 'go' starts a game with Sargon. This is all a trick basically, with stderr output rather than stdout. As soon as you (or more likely a GUI) goes 'uci' it switches into normal UCI operation, as dictated by the UCI specification.
AdminX wrote: ↑Wed Dec 02, 2026 11:13 am
So far so good Bill, interactive shell and commands all appear to be working!
Nice! Thanks. I recommend 'big' command for better ascii art graphics, as long as you can stretch up the terminal. Remember that 'go' starts a game with Sargon. This is all a trick basically, with stderr output rather than stdout. As soon as you (or more likely a GUI) goes 'uci' it switches into normal UCI operation, as dictated by the UCI specification.
I see what you mean!
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers