Playing Chess Against Your Printer, With PostScript

Can you play chess against your printer? The answer will soon be yes, and it’s thanks to [Nicolas Seriot]’s PSChess. It’s a chess engine implemented in PostScript, of all things. It’s entirely working except for one last hurdle, but more on that in a moment.

What’s it like to play PSChess? Currently, one uses a PostScript interpreter (such as GhostScript) to run it, much like one would use the Python interpreter to run Python code. The user inputs moves by typing in commands like d2d4 (representing a piece’s source coordinate and a destination coordinate on the 2D board). Then the program makes a move, and outputs an updated board state to both the console and a PDF document. Then it’s the user’s turn again, and so on until somebody loses.

The chess parts are all working, but there’s one last feature in progress. The final step of the project is to enable PSChess to be run directly on a printer instead of using GhostScript as the interpreter. Intrigued? You can find the code at the project’s GitHub repository.

So why PostScript? While it is a Turing-complete stack-based interpreted language, it was never intended to be used directly by humans. There are no meaningful development tools to speak of. Nevertheless, [Nicolas] finds PostScript an appealing tool for programming projects and provides tips and techniques for like-minded folks. One of the appeals is working within constraints to solve a problem, just like implementing a chess engine in only 4k, or draw poker in 10 lines of BASIC.

Commodore CHESSmate Replica Runs On The ESP32

The Commodore CHESSmate chess computer might not be terribly well known, but that doesn’t make it any less worthy of being reproduced. If anything it is more important, as it gives more people an opportunity to use one of these devices, yet beyond a purely emulated experience the real user interface is harder to experience.

Internals of the reproduction Commodore ChessMate (Credit: Michael Gardi)

This is where [Michael Gardi]’s modernized replica provides a highly accessible version, consisting of a custom PCB with an ESP32 as the brains of the system. Although decidedly overkill next to the 6502 in the original CHESSmate, it makes the project far easier for others to assemble as it contains few components that shouldn’t be readily available.

The ESP32 is mounted on a small daughterboard which plugs into the main PCB with the buttons, LEDs and indicators. The whole stack is then inserted into the 3D printed reproduction case. These 3D models along with the ESP32 port of the CHESSmate firmware can be found in the GitHub repository, along with a minimalist frame and a ‘CHESSmate Lite’ version as alternative enclosure options for those who somehow don’t appreciate the delightful 1980s aesthetics.

We covered the Commodore CHESSmate last year, including a highly faithful reproduction built by [Hans Otten], which [Michael] read the day after meeting [Peter Jennings], the author of MicroChess (which the CHESSmate uses internally) at an event at York University. Taking this as a sign, he set to work on this particular project.

We’re not sure if there’s really a cosmic force directing [Michael] towards his next project, but if there is, we’d like to take this opportunity to thank it for doing a fantastic job so far.

The Quaint History Of The Commodore ChessMate

The Commodore International of the 1970s was a company which dabbled in a bit of everything when it came to consumer electronics, with the Commodore ChessMate being a prime example of the circuitous way that some of its products came to be. Released in 1978, its existence was essentially the result of MOS Technology releasing the KIM-1 single board computer in 1976. In May of that year, [Peter Jennings] traveled all the way from Toronto, Canada to Cleveland, USA to attend the Midwest Regional Computer Conference and acquire a KIM-1 system and box of manuals for a mere $245. On this KIM-1 he’d proceed to develop his own chess game, called MicroChess, implemented fully in 6502 ASM to fit within the 1 kB of RAM.

As one of the first major applications to run on the KIM-1, it quickly became an international hit, which caught the attention of Commodore – which had acquired MOS Technology by then – who ended up contacting [Peter] about a potential chess computer project. This turned out to based on the custom MOS 6504 CPU, while sharing many characteristics with the KIM-1 SBC. Being a MicroChess-only system, the user experience was optimized for more casual users, with the user manual providing clear instructions on how to start a new game and how to enter the position of a newly moved piece, along with no less than eight difficulty settings.

If you’re feeling like making your own ChessMate, or want to dig into the technical details, this excellent article by [Hans Otten] has got you covered.

Top image: Commodore ChessMate Prototype in 1978. (Credit: Peter Jennings)

(Thanks to [Stephen Walters] for the tip)

The Chess Computer From 1912

Who was [Leonardo Torres Quevedo]? Not exactly a household name, but as [IEEE Spectrum] points out, he invented a chess automaton in 1920 that would foreshadow the next century’s obsession with computers playing chess.

Don’t confuse this with the infamous Mechanical Turk, which appeared to be a chess computer but was really a guy hiding inside a fake chess computer. The Spanish engineer’s machine really did play a modified end game. The chessboard was vertical, and pegs represented pieces. There were mechanical arms to move the pegs. The device actually dates back to 1912, with a public demonstration in Paris in 1914. Given [Quevedo’s] native language, the machine was called El Ajedrecista.

Continue reading “The Chess Computer From 1912”

A Chess AI In Only 4K Of Memory

The first computer to ever beat a reigning chess world champion didn’t do so until 1996 when a supercomputer built by IBM beat Garry Kasparov. But anyone who wasn’t a chess Grandmaster could have been getting beaten by chess programs as early as 1979 when Atari released one of the first ever commercially-available chess video games for the Atari 2600. The game was called Video Chess and despite some quirky gameplay it is quite impressive that it was able to run on the limited Atari hardware at all as [Oscar] demonstrates.

The first steps of getting under the hood of this program involved looking into the mapping of the pieces and the board positions in memory. After analyzing some more of the gameplay, [Oscar] discovered that the game does not use trees and nodes to make decisions, likely due to the memory limitations, but rather simulates the entire game and then analyzes it to determine the next step. When the game detects that there are not many pieces left on the board it can actually increase the amount of analysis it does in order to corner the opposing king, and has some unique algorithms in place to handle things like castling, finishing the game, and determining valid movements.

Originally it was thought that this engine couldn’t fit in the 4K of ROM or work within the 128 bytes of system memory, and that it was optimized for the system after first developing a game with some expanded capabilities. The game also has a reputation for making illegal moves in the higher difficulty settings although [Oscar] couldn’t reproduce these bugs. He also didn’t get into any of the tricks the game employed just to display all of the pieces on the screen. The AI in the Atari game was a feat for its time, but in the modern world the Stockfish open-source chess engine allows for a much more expanded gameplay experience.

A metal watch is held in a man's fingers. The watchface has a laser etched chess board with miniature chess pieces made of brass enacting a match. The time is told on an etched chess clock to the right hand side of the timepiece and a small window on the rightmost "clock" shows the date.

A Little Chess With Your Timepiece

Some things remain classics, even after centuries, and chess and watches have certainly stood the test of time. [W&M Levsha] decided to combine them both in this “Chess Club” watch containing a miniature chess game frozen in time.

[W&M Levsha] used an off-the-shelf wristwatch for the mechanism and case, but rearranged the parts and built a custom watchface that’s much nicer than the original. The new watchface was cut and etched on a fiber laser after disassembly of the original watch.

The real magic happens when [W&M Levsha] turns those teeny little chess pieces on the lathe. The knight was a two piece affair with the horse head being laser cut out of brass sheet and then soldered onto a turned base. As you can see from the video embedded below, all of the chess pieces inside the watch could fit on the maker’s fingernail! It’s probably a good thing that this tiny set isn’t playable since trying to play on a board that size would be an exercise in patience.

We’ve seen machined chess sets here before at a larger scale, but if you’re more into 3D printing, how about teaching your printer to play?

Continue reading “A Little Chess With Your Timepiece”

Electronic Shoe Explores Alleged Chess Misbehavior

A few months ago, a scandal erupted in the chess world which led to some pretty wild speculation around a specific chess player. We won’t go into any of the details except to say that there is virtually no physical evidence of any method this player allegedly used to cheat in a specific in-person chess match. But [Teddy Warner] and partner [Jack Hollingsworth] were interested in at least providing a proof-of-concept for how this cheating could have been done, though, and came up with this device which signals a chess player through a shoe.

The compact device is small enough to fit in the sole of one of the player’s shoes, and is powered by an ATtiny412 microcontroller paired with a HC-06 Bluetooth module. The electronics are fitted into a 3D printed case along with a small battery which can then be placed into the sole of a shoe, allowing the wearer to feel the vibrations from a small offset-weight motor. With a second person behind a laptop and armed with a chess engine, the opponent’s moves can be fed into the computer and the appropriate response telegraphed through the shoe to the player.

While [Teddy] and [Jack] considers the prototype a success in demonstrating the ease at which a device like this could be used, and have made everything related to this build open source, this iteration did have a number of issues including that the motor buzzing was noticeable during play, and that his chess engine made some bizarre choices in the end game. It also requires the complicity of a second person, which is something this other chess cheating machine does away with. They also note that it’s unlikely that any chess players at the highest levels use devices like these, and that other chess experts have found no evidence of any wrongdoing in this specific scandal.

Continue reading “Electronic Shoe Explores Alleged Chess Misbehavior”