Brickley Roscowicz Engineering

Brickley Roscowicz Engineering


NXT Miniature Chess Game Print E-mail

See my other NXT Projects

October 2006 -

Chess is a very popular game, and many, many chess-playing computer programs have been written. It would be nice to have a full chess program for the NXT, however I doubt that would be possible given it's memory limitations.

However, it is possible to write a program that plays miniature chess on a 5x5 board using a relatively small amount of memory. So I decided to try to write one for the NXT.

But after several weeks of working with John Hansen and Tamas Sorosy, I've come to the conclusion that this project may be pushing something too hard. I have a program that basically works, but still needs a lot added to be anywhere near finished. Unfortunately, due to the erratic behaviour of the program, debugging has become pretty much impossible, so I've shelved the project for now. Maybe when RobotC supports structs and arrays of structs (and nested structs and arrays of nested structs containing arrays...) I might try that.

I'm not able to work out whether it's a firmware, compiler, or program issue, or a combination. If someone wants to take it further, please feel free. If you are able to get it to work consistently on your NXT, I'd be very pleased to hear about it.

The program uses images to represent the pieces. These images are included in the ZIP file, and must be downloaded to the NXT before you run the program, or the board will look blank. If you enjoy blindfold chess you can play it that way if you want :)

To adjust the look-ahead, you need to change the line with

#define MAX_DEPTH 2

This defines the total number of levels searched - one move by each player constitutes a value of 2. That plays very fast, but can be beaten pretty easily. A value of 4 plays quite well, but can take several minutes per move.

To play, use arrow keys to select piece to move, then use them to select square to move to. There is no double initial pawn move, no en pasant, no castling. Pawns always promote to a queen.

Anyway, click here for the NBC source code. You will need at least the beta 12 version of NBC for NXT Miniature Chess.