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.
BootChess (minimal chess engine)
Moderators: hgm, Rebel, chrisw
-
- Posts: 64
- Joined: Thu Feb 19, 2009 5:34 pm
- Location: Mexico, Mexico
Re: BootChess (minimal chess engine)
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
-
- Posts: 10300
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
Re: BootChess (minimal chess engine)
I doubt there is a chess engine that includes draw detection for every chess position based on rule 5.2b(you can ask for draw detection for all the cases that are not covered by 5.2b)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.
For example it needs to detect a draw in the following position
[D]4kb2/8/8/p1p1p1p1/PpP1P1P1/1P6/2B5/1K6 w - - 1 1
relevant rule
The game is drawn when a position has arisen in which neither player can checkmate the opponent’s king with any series of legal moves. The game is said to end in a ‘dead position’. This immediately ends the game, provided that the move producing the position was in accordance with Article 3 and Articles 4.2 – 4.7.
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: BootChess (minimal chess engine)
Fantastic!! And without clever tricksnanochess wrote:And here it is Toledo Atomchess
Congratulations
It has indeed search I also like the randomization so it never plays the same game twice...
Now this is truly incredible and so much better than BootChess, don't you feel pity now for the guys who wrote it?
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: BootChess (minimal chess engine)
I also found your 3d tanks entry for IOCCC
I've never seen anything better in 3.5k chars of C code.
I've never seen anything better in 3.5k chars of C code.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: BootChess (minimal chess engine)
This has been discussed before, but resigning is not 'playing chess'. It is actually exactly the opposite, namely the way to express that you are not prepared to play chess (anymore).bob wrote:Here is the smallest program that plays legal chess according to FIDE rules:
int main() {
printf("I offer a draw, accept? ");
scanf("%s", answer);
if (!strcmp(answer, "yes"))
exit 0;
printf("I resign\n");
}
So the program you give here can only be said to "not play chess, in a FIDE-compliant way". Complying with FIDE rules does not automatically imply you are 'playing chess'. The FIDE rules for example also require you to shake hands before a game. That doesn't mean that shaking hands is playing chess...
-
- Posts: 64
- Joined: Thu Feb 19, 2009 5:34 pm
- Location: Mexico, Mexico
Re: BootChess (minimal chess engine)
Thanks! and errr, no, they didn't made enough effort. I would never put out a program with a bug so clear as putting its own king in check.mar wrote:Fantastic!! And without clever tricksnanochess wrote:And here it is Toledo Atomchess
Congratulations
It has indeed search I also like the randomization so it never plays the same game twice...
Now this is truly incredible and so much better than BootChess, don't you feel pity now for the guys who wrote it?
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
-
- Posts: 64
- Joined: Thu Feb 19, 2009 5:34 pm
- Location: Mexico, Mexico
Re: BootChess (minimal chess engine)
I'm glad you liked it Thanks!mar wrote:I also found your 3d tanks entry for IOCCC
I've never seen anything better in 3.5k chars of C code.
The good old times
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
-
- Posts: 593
- Joined: Sat Aug 20, 2011 9:43 am
Re: BootChess (minimal chess engine)
That's funny Bob. But it's not legal to offer a draw before you've moved. So, you'd need to do something like, play 1.e4, then offer the draw.bob wrote:
Here is the smallest program that plays legal chess according to FIDE rules:
int main() {
printf("I offer a draw, accept? ");
scanf("%s", answer);
if (!strcmp(answer, "yes"))
exit 0;
printf("I resign\n");
}
Has anyone gotten BootChess to run in Linux? I installed DosBox and entering "dosbox" from ~/bootchess gives me a window showing the board but I can't enter moves.
-
- Posts: 1643
- Joined: Tue May 20, 2008 4:57 pm
- Location: Augsburg - Germany
Re: BootChess (minimal chess engine)
Is an implementation afterwards of the WinBoard or/and UCI-protocol possible for BootChess Engine?
Another legacy software, MicroChess 1976, runs nowadays with WinBoard-GUI, cf. the German website http://www.andreadrian.de/schach/index.html
Best wishes,
Norbert
Another legacy software, MicroChess 1976, runs nowadays with WinBoard-GUI, cf. the German website http://www.andreadrian.de/schach/index.html
Best wishes,
Norbert
-
- Posts: 558
- Joined: Sat Mar 25, 2006 8:27 pm
Re: BootChess (minimal chess engine)
Then how about
FIDE rules don't actually require you to make any moves before your flag falls, do they?
Code: Select all
int main() {
}