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.
BootChess (minimal chess engine)
Moderators: hgm, Rebel, chrisw
-
- Posts: 127
- Joined: Sat Jan 22, 2011 7:14 pm
- Location: Lille, France
-
- Posts: 2568
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
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.
-
- Posts: 27870
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: BootChess (minimal chess engine)
Very impressive.
-
- Posts: 2204
- Joined: Sat Jan 18, 2014 10:24 am
- Location: Andorra
-
- Posts: 12568
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
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.
-
- Posts: 127
- Joined: Sat Jan 22, 2011 7:14 pm
- Location: Lille, France
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.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
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");
}
-
- Posts: 2568
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
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$'
-
- Posts: 2204
- Joined: Sat Jan 18, 2014 10:24 am
- Location: Andorra
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
-
- Posts: 64
- Joined: Thu Feb 19, 2009 5:34 pm
- Location: Mexico, Mexico
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 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.
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