The world's smallest chess engines

9/23/2015 – In the world of chess computing, the actual records that are sought after usually deal with the chess engine 'arms race' for the highest Elo. After all, it is the easiest thing to measure. However, until recently there was another record that had stood the test of time for decades: the world's smallest chess engine. The new champions are as small as three Twitter messages.

Everyone uses ChessBase, from the World Champion to the amateur next door. Start your personal success story with ChessBase 14 and enjoy your chess even more!

Along with the ChessBase 14 program you can access the Live Database of 8 million games, and receive three months of free ChesssBase Account Premium membership and all of our online apps! Have a look today!

The smallest of them all

The first thing to do is understand what the smallest chess program means. We are not talking about fitting it into something the size of the eye of a needle. We are talking about the smallest amount of actual code required to build a fully-functional chess program that can be played against.

The previous champion was a chess engine that was built almost out of sheer necessity: 1K ZX Chess - a Sinclair ZX81 computer game, which contained 672 bytes of code. They say that necessity is the mother of invention, and this little programming gem fits the bill in the spades.

The Sinclair ZX81 was a pioneering computer that came out in 1981, designed to make it possible to put personal computers in the normal blue-collar homes of the time. To understand the market then, the kings of the heap such as the Apple II retailed for well over US$1000, whereas by contrast the ZX81 cost an incredible £49.95 for the kit, which even today translates to roughly £171 in 2015. This feat wasn't done by using sweat factories in China, but by its brilliant Spartan design, albeit fully functional.

The legendary Sinclair ZX81. Today's Raspberry Pi is a tribute to its minimalism and affordability.

The ZX81 was designed to be small, simple, and above all cheap, using as few components as possible to keep the cost down. Video output was to a television set rather than a dedicated monitor. Programs and data were loaded and saved onto audio tape cassettes. It had only four silicon chips on board and a mere one kilobyte of memory. The machine had no power switch or any moving parts, and used a pressure-sensitive membrane keyboard for manual input. The operating system was Sinclair BASIC.

It was hugely successful, selling more than 1.5 million units, however its limitations required the utmost creativity in software design. You may have noted the one kilobyte of RAM, and thought it was some form of typo. It was not. It literally had one kilobyte, which is one millionth of 1GB.

The British programmer David Horne managed to create a chess program that fit within those draconian restrictions and in a mere 672 bytes had a working chess program. Understandably, as such restrictions were lifted with the ever-evolving computers, the subsequent focus was more on trying to exploit these newer technologies, and see how far they could go.

It was a different time, and in the February 1983 issue of 'Your Computer' a detailed article
with the complete code was published by the author himself. Here is the cleaned up code.

This is what a game against 1K ZX81 Chess looked like

Today it is clear that these limits, which at first existed due to floppy disc space, then CDs, then DVDs, no longer exist really. Massive virtual reality quality games that take up dozens of gigabytes of space continue to come out and grow. Coming around to full circle, there is now a movement called 'sizecoding' that challenges programmers to seek to be as efficient as possible in their coding, optimizing not only for speed but sheer code size.

To this day, 34 years later, there are still active forums on the machine and programming it

This is how BootChess eventually came into existence. The French coder Olivier Poudade managed to produce a chess engine in code that can be run on Windows, MacOS and Linux, in just 487 bytes! To grasp how absurdly small that is, just over three imageless Tweets would take up about that much data.

Although some have criticized BootChess for not being able to handle the rule of castling, it must be noted that nor could 1k ZX Chess. On the other hand, 1K ZX chess was also unable to handle pawn promotion into a queen, whereas BootChess can.

This is a screenshot of the BootChess page where the code can be freely studied and copied to try out.
You will note the detailed notes on the right side of the actual code to help understand how it works.

To achieve his goal, Mr Poudade - a member of the Red Sector Inc coding group - had to make the look of his game even more basic than its 1982 predecessor. The board and pieces of BootChess are represented by text alone, with P representing pawns, Q used for the queens and full stops put in the place of empty squares.

Full functionality

The caveats of the claims have been made, and while BootChess is certainly smaller and more functional than its great predecessor, it is nonetheless unable to play according to all the rules, such as en-passant or castling. This is understandable. Mark Lefler, the programmer of Komodo 9, explained, "castling and en-passant take up a lot of code to get right."

So who are the true kings of fully functional minimalism? Only two programs under 2kb today are able to play a game with all the rules, no shortcuts allowed: Tiny Chess and MicroMax.

Toledo Nanochess is a miniature chess program that was written in JavaScript by Mexican developer Oscar Toledo G, and that fits in just 1251 bytes and is available to play against with a proper graphical representation of the board and pieces. Try your hand against it at Tiny Chess.

MicroMax is the strongest of the minatures and will actually give
you a decent game without being a bully. Well worth a try!

MicroMax is programmed by Dutch programmer H.G. Muller, who is also the author of the graphical interface Winboard. MicroMax is exactly 1433 characters long, and can be downloaded at the author's official page. He also provides generous commentary on the challenges and its inner workings. You can also find information at the ChessProgramming Wiki page.

Albert SilverBorn in the US, he grew up in Paris, France, where he completed his Baccalaureat, and after college moved to Rio de Janeiro, Brazil. He had a peak rating of 2240 FIDE, and was a key designer of Chess Assistant 6. In 2010 he joined the ChessBase family as an editor and writer at ChessBase News. He is also a passionate photographer with work appearing in numerous publications.

See also

12/30/2017 – The "King Salman World Blitz & Rapid Championships 2017" in Riyadh from Decemer 26th to 30th. At the half way point of the Blitz Championship, the defending champ Sergey Karjakin leads with 9 / 11. Maxime Vachier-Lagrave is a half point back followed by Peter Svidler and a trio of Chinese: Wang, Ding and Yu on 8 / 11. In the Women's Pia Cramling has a full point lead with 9½ / 11. Watch live with Rounds 11 to 22 from 12:00 Noon CET (6:00 AM EST) on Saturday with commentary by E. Miroshnichenko & WGM K. Tsatsalashvili.

See also

12/6/2017 – Imagine this: you tell a computer system how the pieces move — nothing more. Then you tell it to learn to play the game. And a day later — yes, just 24 hours — it has figured it out to the level that beats the strongest programs in the world convincingly! DeepMind, the company that recently created the strongest Go program in the world, turned its attention to chess, and came up with this spectacular result.

Video

The introductory position of the Kasparov Gambit can occur after 1 d4,1 Nf3 and 1 c4, which can appeal to a wide range of players. The usual move order is 1 d4 Nf6 2 c4 c5 3 Nf3 cxd4 4 Nxd4 e5!? 5 Nb5 d5 6 cxd5 Bc5 bringing us to a very sharp position. On this 60 mins, FIDE Senior Trainer Andrew Martin argues the case from the Black side, showing both classic Kasparov masterpieces and games from the present day and suggests that White's defensive task is not easy. This is a practical gambit which will help players at all levels to win more games. It is ideal for must-win situations with Black. It is a gambit that White cannot decline,as if he does, Black gets a good position instantly. White must take up the cudgels and fight!

Enjoy the best moments of recent top tournaments (World Cup, Isle of Man Open) with analysis of top players. In addition you'll get lots of training material. For example 10 new suggestions for your opening repertoire.