BootChess (minimal chess engine)
Moderators: hgm, Dann Corbit, Harvey Williamson
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
BootChess (minimal chess engine)
Hi all,
A friend just let me know about a 487-byte chess "engine". Don't expect FIDE compliance or search for this size! It will move into check for example; consider it a variant.
Release announcement: http://www.pouet.net/prod.php?which=64962
Direct link: http://olivier.poudade.free.fr/arc/BootChess.zip
Fabien.
A friend just let me know about a 487-byte chess "engine". Don't expect FIDE compliance or search for this size! It will move into check for example; consider it a variant.
Release announcement: http://www.pouet.net/prod.php?which=64962
Direct link: http://olivier.poudade.free.fr/arc/BootChess.zip
Fabien.
Re: BootChess (minimal chess engine)
some nice tricks to keep it small, including self-modifying code, relative addressing to save some bytes etc. 
including instructions no optimizer will ever emit, I also like the idea of using segment register as a temporary and the use of BCD-adjustment instructions.
very nice.

including instructions no optimizer will ever emit, I also like the idea of using segment register as a temporary and the use of BCD-adjustment instructions.
very nice.
- hgm
- Posts: 25842
- Joined: Fri Mar 10, 2006 9:06 am
- Location: Amsterdam
- Full name: H G Muller
- Contact:
Re: BootChess (minimal chess engine)
Very impressive.
-
- Posts: 11989
- Joined: Wed Mar 08, 2006 7:57 pm
- Location: Redmond, WA USA
- Contact:
Re: BootChess (minimal chess engine)
Truly astounding.Xann wrote:Hi all,
A friend just let me know about a 487-byte chess "engine". Don't expect FIDE compliance or search for this size! It will move into check for example; consider it a variant.
Release announcement: http://www.pouet.net/prod.php?which=64962
Direct link: http://olivier.poudade.free.fr/arc/BootChess.zip
Fabien.
Your description of your program raises the question,
"How small can a chess engine be made which can correctly process every fide rule, including draw detection, underpromotion, e.p. capture, etc.?"
I guess that it cannot be done in under 1024 bytes.
Re: BootChess (minimal chess engine)
Just to be clear, it's not my program.Dann Corbit wrote:Your description of your program raises the question, ...
Fabien.
Re: BootChess (minimal chess engine)
Here is the smallest program that plays legal chess according to FIDE rules:Dann Corbit wrote:Truly astounding.Xann wrote:Hi all,
A friend just let me know about a 487-byte chess "engine". Don't expect FIDE compliance or search for this size! It will move into check for example; consider it a variant.
Release announcement: http://www.pouet.net/prod.php?which=64962
Direct link: http://olivier.poudade.free.fr/arc/BootChess.zip
Fabien.
Your description of your program raises the question,
"How small can a chess engine be made which can correctly process every fide rule, including draw detection, underpromotion, e.p. capture, etc.?"
I guess that it cannot be done in under 1024 bytes.
int main() {
printf("I offer a draw, accept? ");
scanf("%s", answer);
if (!strcmp(answer, "yes"))
exit 0;
printf("I resign\n");
}

Re: BootChess (minimal chess engine)
Actually the program could always resign, making it even smaller (17 bytes):
But yours is clearly stronger.
Code: Select all
org 100h
mov ah, 9
mov dx, msg
int 21h
retn
msg db 'I resign$'
Re: BootChess (minimal chess engine)
mar wrote:Actually the program could always resign, making it even smaller (17 bytes):
But yours is clearly stronger.Code: Select all
org 100h mov ah, 9 mov dx, msg int 21h retn msg db 'I resign$'



Daniel José -
http://www.andscacs.com

Re: BootChess (minimal chess engine)
I didn't liked the fact it puts its own king in check and only considers half-ply (per author comments), so I made from scratch my own program.
And here it is Toledo Atomchess
in only 481 bytes of x86 machine code, it searchs 3-ply depth and doesn't make illegal moves http://nanochess.org/chess6.html
Alas, it also makes only basic chess moves.
And here it is Toledo Atomchess

Alas, it also makes only basic chess moves.
All good things are difficult to achieve.
Toledo Nanochess book http://www.amazon.com/Toledo-Nanochess- ... 1304864375
Toledo Nanochess book http://www.amazon.com/Toledo-Nanochess- ... 1304864375