Here are some values on the program size
Graphics Lib and Font data: 6 KB
GUI, Bitmaps and Chess Engine: 5 KB
About the program development:
First I did research on existing chess engines. I found some very
small (regarding code size) engines, but they seem to be very cryptic and still use
a lot of ram. There is also one ATMEGA port of one engine, but I was not
able to understand how to control that engine.
The other issue has been the copyright. Many implementation did not fit to
the LGPL, which had been the intended license for the chess game.
And finally, I wanted a small implementation for the Uno. This requires
some tricks in C...
... so I started writing my own implementation. First step had been to implement
a "legal move finder". Once the program knows all legal moves for a color
and a given board setup, it is quite easy to setup a simple chess engine which
selects randomly a legal move.
I moved on and implemented a simple search algorithm for the best move.
The current algorithm is quite simple: negamax. Best move rating is mainly
based on the material. If you loose a rook, it is rated as a bad move.
Most ideas and links are covered here:http://chessprogramming.wikispaces.com/
The most important improvement would be to implement alpha-beta search.
But I first wanted something working before that.
Code is here:http://code.google.com/p/dogm128/source/browse/libraries/Dogm/utility/chess.c
PDE (just a simple wrapper) is herehttp://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/Chess/Chess.pde