P.S.
This is the world's smallest chess program. It plays legal chess, but
it will not fare very well in contests:
#include <stdio.h>
int main(void)
{puts("I resign.");retur n 0;}
Let me clarify something here.
This discussion is obviously only meaningfull is there is an
unambiguous definition of the concept 'Chess Program'. Like always,
when exploring a boundary, this is not completely obvious what this
should be.
I always have found the following definition to work satisfactory:
A chess program is a program that, according to unambiguous
input/output rules defined by the programmer, is able to score
significantly (in the statistical sense) better than 50% against an
opponent that plays random legal moves.
This would exclude quirks like the one above. (Which I consider a good
thing.) Also note that the random move generator does not yet qualify
as a chess program. (In topological terms, it is on the edge, but not
in the set itself.) To be a chess program you have to do something
more, but it can be an infinitesimal amount.
According to my definition, it is not a requirement that the program
plays legal moves in every situation. Requiring so, would be tantamount
to requiring that the program contains no bugs. Since in general this
cannot be proven for a language as powerful as C, requiring such a
thing would render the definition useless. Giving off an illegal move
should simply be counted as a resignation. If a program that has a
habit of doing this does not do it so often that it no longer clearly
beats the random mover, it still is a chess program.
According to this definition, both micro-Max and Toledo are chess
programs by a large margin. Micro-Max is smaller. And stronger :D,
despite the fact that (unlike what was stated above) it does neither
do, nor accept minor promotions. If the opponent does a minor promotion
that makes a difference (i.e. the piece is not immediately captured)
the response of micro-Max should be considered a resignation. This has
negligible impact on its performance.
I don't know if micro-Max is actually the world's smallest chess
program, but I am not aware of any program that is smaller.