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.

Play Chess Like Harry Potter

If you are a Harry Potter fan, you might remember that one of the movies showed an Isle of Lewis chess set whose pieces moved in response to a player’s voice commands. This feat has been oft replicated by hackers and [amoyag00] has a version that brings together a Raspberry Pi, Arduino, Android, and the Stockfish chess engine in case you want to play by yourself. You can see a video of the game, below.

Interestingly, the system uses Marlin — the 3D printing software — to handle motion using the Arduino. We suppose moving chess pieces over a path isn’t much different than moving a print head. It is certainly a novel use of GCode.

Continue reading “Play Chess Like Harry Potter”

Raspberry Pi Powers This Retro Chess Computer

If you imagine somebody playing chess against the computer, you’ll likely be visualizing them staring at their monitor in deep thought, mouse in hand, ready to drag their digital pawn into play. That might be accurate for the folks who dabble in the occasional match during their break, but for the real chess aficionados nothing beats playing on a real board with real pieces. Of course, the tricky part is explaining the whole corporeal thing to a piece of software on your computer.

Enter the “Chess Challenger” by [slash/byte]. Modeled after a commercial gadget of the same name from 1978, his retro-themed open hardware design utilizes the Raspberry Pi Zero and modern chess software to bring the vintage concept into the 21st century. With the Chess Challenger and a standard board, the player can face off in an epic battle of wits against the computer without risk of developing carpal tunnel. We can’t guarantee though that a few boards might not get flipped over in frustration.

The pocket sized chess computer uses a “sandwich” style construction which shows off the internals while still keeping things reasonably protected. All of the electronics are housed on the center custom PCB which features a HT16K33 driver for the dual LTP-3784E “starburst” LED displays, a MCP1642B voltage regulator, 16 TL3305 tactile switches for the keyboard, and a MCP73871 battery management chip for the 3.7 volt lithium-ion battery that powers the whole show. The Pi Zero itself connects to the board by way of the GPIO header, and is mechanically supported by the standoffs used to hold the device together.

On the software side of things, the Pi is running the mature Stockfish open source chess engine. In development now for over a decade, this GPL licensed package aims to deliver a world-class chess gameplay on everything from smartphones to desktop computers, and we’ve seen it pop up in a number of projects over the years. [slash/byte] has provided a ready to flash SD card image for the Raspberry Pi, and even provides detailed installation and setup instructions which guide you through some of the more thorny aspects of the setup such as getting the Pi running from a read-only operating system so that abrupt power cuts don’t clobber the filesystem.

Over the years, some of the most impressive projects we’ve seen revolved around playing chess, and this latest entry by [slash/byte] is no exception. Another example of the lengths the chess community will go to perfect the Game of Kings.

Continue reading “Raspberry Pi Powers This Retro Chess Computer”

Play Chess Against A Ghost

While chess had long been a domain where humans were superior to computers, the balance has shifted quite substantially in the computers’ favor. But the one thing that humans still have control over is the pieces themselves. That is, until now. A group has built a robot that both uses a challenging chess engine, and can move its own pieces.

The robot, from creators [Tim], [Alex S], and [Alex A], is able to manipulate pieces on a game board using a robotic arm under the table with an electromagnet. It is controlled with a Raspberry Pi, which also runs an instance of the Stockfish chess engine to play the game of chess itself. One of the obvious hurdles was how to keep the robot from crashing pieces into one another, which was solved by using small pieces on a large board, and always moving the pieces on the edges of the squares.

This is a pretty interesting project, especially considering it was built using a shoestring budget. And, if you aren’t familiar with Stockfish, it is one of the most powerful chess engines and also happens to be free and open-source. We’ve seen it used in some other chess boards before, although those couldn’t move their own pieces.

Continue reading “Play Chess Against A Ghost”

Digital Opponent In An Analog Package

Unsatisfied with the present options for chess computers and preferring the feel of a real board and pieces, [Max Dobres] decided that his best option would be to build his own.

Light and dark wood veneer on 8mm MDF board created a board that was thin enough for adding LEDs to display moves and for the 10mm x 1mm neodymium magnets in the pieces to trip the reed switches under each space. The LEDs were wired in a matrix and connected to an Arduino Uno by a MAX7219 LED driver, while the reed switches were connected via a Centipede card. [Dobres] notes that you’ll want to test that the reed switches are positioned correctly — otherwise they might not detect the pieces!

Continue reading “Digital Opponent In An Analog Package”