Current world's smallest chess program

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Current world's smallest chess program

Post by Jim Ablett »

Denis P. Mendoza wrote:
Jim Ablett wrote:
Please, Jim, could you also replace the source in your Toledo_nanochess zip download by this version? There is no need to recompile, the removal of an unused global variable should have no effect on the executable.
Done.

New download link:
http://www.mediafire.com/?ojn4ejmhx0z

Jim.
Jim,

I can't seem to download this file using the link given. Thanks.

Denis
Mirror:
http://www.live-share.com/files/382372/ ... l.zip.html

Jim.
User avatar
nanochess
Posts: 64
Joined: Thu Feb 19, 2009 5:34 pm
Location: Mexico, Mexico

Re: Current world's smallest chess program

Post by nanochess »

I was talking about PGN of this match. Also, could someone point me to the nunn.pgn file?
hgm wrote:I tried a Nunn match between micro-Max 1.6 and Toledo_nanochess. (Yes, the protocol of this new Toledo does support force mode, so you can play it with an external book!) To make for approximately fair CPU time usage I set uMax to 500,000 nodes (minimum) and Toledo-nC to 4 ply. (This requires altering of the source and re-compilation; the standard version of Toledo-nC is set for 5 ply.) This sets the programs to blitz speed.

It seems the programs are well matched at this speed (5+, 11=, 4- in the advantage of uMax). As both programs cannot recognize repeats, there are a lot of unnecessary draws. The worst cases of this were uMax not being able to win in KRBPPPPPK, and Toledo not being able to win KQKP (with a 4th-rank Pawn...). It is difficult to design compltely air conditions, as Toledo-nC uses fixed-depth, and uMax plays by node-count. So Toledo-nC tends to think longer in the middle-game, but then completely catches up in the end-game. In the end one of the two is likely to have used much more time than the other, (typically twice as much), but who that is depends on when the Queens were traded, and if there was a quick mate or a tedious end-game.

Nevertheless, they play purposefully, and both are able to win games. 8-)
User avatar
Denis P. Mendoza
Posts: 415
Joined: Fri Dec 15, 2006 9:46 pm
Location: Philippines

Re: Current world's smallest chess program

Post by Denis P. Mendoza »

Jim Ablett wrote:
Denis P. Mendoza wrote:
Jim Ablett wrote:
Please, Jim, could you also replace the source in your Toledo_nanochess zip download by this version? There is no need to recompile, the removal of an unused global variable should have no effect on the executable.
Done.

New download link:
http://www.mediafire.com/?ojn4ejmhx0z

Jim.
Jim,

I can't seem to download this file using the link given. Thanks.

Denis
Mirror:
http://www.live-share.com/files/382372/ ... l.zip.html

Jim.
Thanks Jim. got tit this time :wink: !
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Current world's smallest chess program

Post by hgm »

nanochess wrote:I was talking about PGN of this match. Also, could someone point me to the nunn.pgn file?
The Nunn.pgn is included in the WinBoard Gold Pack, which is available for download from the WinBoard forum. ( http://www.open-aurec.com/wbforum/viewt ... 19&t=49439 )

It mut be available as a smaller download somewhere, but I forgot where I got it from.
ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Re: Current world's smallest chess program

Post by ernest »

hgm wrote:It mut be available as a smaller download somewhere, but I forgot where I got it from.
The WinBoard Gold Pack contains the Nunn2 (20 opening positions) file.
Both Nunn2(20) and Nunn1(10) files can be found at Kurt Utzinger's site:

http://www.utzingerk.com/test.htm
User avatar
nanochess
Posts: 64
Joined: Thu Feb 19, 2009 5:34 pm
Location: Mexico, Mexico

Re: Current world's smallest chess program

Post by nanochess »

Update, Toledo Nanochess now is 3 characters smaller, 30% faster and corrects two bugs: one is handling of special cases of castling (detected when I runned a Nunn match), the other is the crash under Cygwin (cannot call main recursively), this also makes main compliant with the standard int main(void). 8-)

I uploaded to my site the results of the Nunn match versus Micromax v1.6, +5 =11 -4 in advantage for Toledo Nanochess. Both programs in factory-default settings.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Current world's smallest chess program

Post by hgm »

Meaning that Toledo_nanochess thinks 20 times longer than micro-Max? :roll:

OK, I admit that Toledo_nanochess must play a quite reasonable game to be able to achieve this result even at such time odds. (Which is a fantastic acheivement for a program that could be printed on a stamp. Don't bother designing a logo, just use the source code in small font! :lol: ) But it does seem a bit misleading...
AndreAdrian
Posts: 2
Joined: Tue Aug 24, 2021 5:22 pm
Full name: Andre Adrian

Re: Current world's smallest chess program

Post by AndreAdrian »

Hello H.G.Muller. My second do-it-yourself chess computer is another port of your Micro-Max 4.8 program. In 2009 I made a port to AVR ATMega, called AVR-Max, a 8-bit CPU with 1 KByte RAM. Now I made a port to ESP32, ESP32-S2, ESP32-C3, called ESP32-Max, these are 32-bit CPUs with up to 4MByte RAM. This time I will use TFT with touchscreen for user interface, not 7-segment-LED and push-buttons.
Can I use your Micro-Max 4.8 source code again? Are you interested in this project? An ESP32 devkit is 10€, a touchscreen TFT is 20€. You need breadboard and no soldering. The development environment Arduino IDE is free and programming is via USB-cable. A first ESP32-Max demonstration is on . The TFT with Mandelbrot program you can see at An older article about this project is at http://www.andreadrian.de/ESP_Schachzwerg/
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Current world's smallest chess program

Post by hgm »

Sure, you can use Micro-Max any time you want.
klx
Posts: 179
Joined: Tue Jun 15, 2021 8:11 pm
Full name: Emanuel Torres

Re: Current world's smallest chess program

Post by klx »

Ancient post, but the choice of not counting whitespace characters is a bit odd to me. I suppose you could encode all your logic in a string consisting of space and tab characters for a very "short" entry.
[Moderation warning] This signature violated the rule against commercial exhortations.