Technology

Coder creates smallest chess game for computers

BootChess Image copyright Red Sector
Image caption BootChess' developer says he hopes to inspire the creation of other small programs

A French coder has developed what is thought to be the smallest-sized chess computer program.

BootChess is only 487 bytes in size, and the code can be run on Windows, Mac OS X and Linux computers.

That makes it smaller than 1K ZX Chess - a Sinclair ZX81 computer game, which contained 672 bytes of code and had held the record for 33 years.

The new title's creator told the BBC that the challenge had seemed impossible at first.

Olivier Poudade added that he hoped his achievement would now inspire other programmers to get involved in the "sizecoding" scene.

"[It] demonstrates why assembly language is still the language of choice to excel [at] in programming," he said.

Image copyright David horne
Image caption 1K ZX Chess was put on sale in 1982 before appearing in a programming magazine the following year

"[And it] reminds others that optimising in computer programming is not only about speed, but also about size."

He said that he had also wanted to pay tribute to the craft of David Horne - 1K ZX Chess' creator - as well as other unsung heroes of the 1980's English and Russian ZX81 and ZX Spectrum coding community.

The ZX81 only had 1K - or 1,024 bytes - of RAM memory, limiting what it could do.

Today's computers typically ship with chips that can store millions of times that amount.

For comparison's sake, even a couple of image-less tweets take up roughly the same amount of data as Mr Poudade's complete program.

Pawn promotion

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.

Image copyright Oscar Toledo G
Image caption Tiny Chess is more than twice the size of BootChess but has better graphics

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.

Some critics have carped that it cannot be called a "complete" chess program because it does not allow castling - a defensive move in which a king and castle/rook shift positions simultaneously.

However, Mr Poudade noted that 1K ZX Chess shared the same limitation, and highlighted that his program allowed pawns to be turned into queens when they reached the opponent's side of the board, something that was not possible in Mr Horne's game.

Even so, for those seeking a code-anaemic version of the centuries-old game that uses graphics rather than letters to represent the board and supports castling, then the 1,251 bytes-sized Tiny Chess, written in Javascript by Mexican developer Oscar Toledo G, may be the preferred option.

Related Topics

More on this story

Related Internet links

The BBC is not responsible for the content of external Internet sites