473,856 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

World smallest chess program

Hi, a year ago I won the 2005 Best Game categoryof the International
Obfuscated C Code Contestwith a chess program.
http://www.ioccc.org/whowon2005.html
http://www.mailcom.com/ioccc/toledo/hint.htmBut this post is because I
have discovered (asurprise for me) that it is also the worldsmallest
chess program written in C language.It has a size of 3004 bytes, or
2261 bytes simplydeleting all the spacing that makes the knightfigure,
cutting down the evaluation function wouldmake it smaller but that
deteriorates the computergamepla y.By the way, if someone doesn't play
chess, here isa simple modification to make the computer playversus
itself, change 1<L&e to 1Regards,Óscar Toledo G.http://www.biyubi.com/

Nov 22 '06 #1
63 15295
Hi, a year ago I won the 2005 Best Game category
of the International Obfuscated C Code Contest
with a chess program.

http://www.ioccc.org/whowon2005.html
http://www.mailcom.com/ioccc/toledo/hint.htm

But this post is because I have discovered (a
surprise for me) that it is also the world
smallest chess program written in C language.

It has a size of 3004 bytes, or 2261 bytes simply
deleting all the spacing that makes the knight
figure, cutting down the evaluation function would
make it smaller but that deteriorates the computer
gameplay.

By the way, if someone doesn't play chess, here is
a simple modification to make the computer play
versus itself, change 1<L&e to 1

Regards,
Óscar Toledo G.
http://www.biyubi.com/

Nov 22 '06 #2
bi****@gmail.co m wrote:
Hi, a year ago I won the 2005 Best Game category
of the International Obfuscated C Code Contest
with a chess program.

http://www.ioccc.org/whowon2005.html
http://www.mailcom.com/ioccc/toledo/hint.htm

But this post is because I have discovered (a
surprise for me) that it is also the world
smallest chess program written in C language.

It has a size of 3004 bytes, or 2261 bytes simply
deleting all the spacing that makes the knight
figure, cutting down the evaluation function would
make it smaller but that deteriorates the computer
gameplay.

By the way, if someone doesn't play chess, here is
a simple modification to make the computer play
versus itself, change 1<L&e to 1

Regards,
Óscar Toledo G.
http://www.biyubi.com/
And it works!

Incredible!

Mis sinceras felicitaciones. Eso es una obra de arte.

jacob
Nov 22 '06 #3
But where is the setjmp.h???

Nov 22 '06 #4

bi****@gmail.co m wrote:
Hi, a year ago I won the 2005 Best Game categoryof the International
Obfuscated C Code Contestwith a chess program.
http://www.ioccc.org/whowon2005.html
http://www.mailcom.com/ioccc/toledo/hint.htmBut this post is because I
have discovered (asurprise for me) that it is also the worldsmallest
chess program written in C language.It has a size of 3004 bytes, or
2261 bytes simplydeleting all the spacing that makes the knightfigure,
cutting down the evaluation function wouldmake it smaller but that
deteriorates the computergamepla y.By the way, if someone doesn't play
chess, here isa simple modification to make the computer playversus
itself, change 1<L&e to 1Regards,Óscar Toledo G.http://www.biyubi.com/
It's not the smallest C chess program in the world.
http://home.hccnet.nl/h.g.muller/max1.html

Nov 23 '06 #5
dc*****@connx.c om wrote:
bi****@gmail.co m wrote:
have discovered (asurprise for me) that it is also the worldsmallest
chess program written in C language.It has a size of 3004 bytes, or
2261 bytes

It's not the smallest C chess program in the world.
http://home.hccnet.nl/h.g.muller/max1.html
That page says that its software doesn't even implement
the rules of chess properly .. I don't think that counts

Nov 23 '06 #6
On 22 Nov 2006 16:19:32 -0800, "keith_emer son" <ni*********@gm ail.com>
wrote in comp.lang.c:
But where is the setjmp.h???
It's a standard header supplied with every standard C compiler. If
your compiler does not have it available, it is either a very strange
non-conforming compiler, or perhaps it is installed incorrectly.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 23 '06 #7
bi****@gmail.co m wrote:
Hi, a year ago I won the 2005 Best Game categoryof the International
Obfuscated C Code Contestwith a chess program.

cutting down the evaluation function would make it smaller but that
deteriorates the computer gameplay.
Well, in the 5-ply mode I won in 8 moves the first game, and it
allows repetition of the same game each time. You might like
to mix it up a bit by randomizing amonst the top few candidate
moves, if they all have similar evaluations.

The game was: 1. e4 Nc6; 2. d4 Nf6; 3. Bd3 d5; 4. e5 Nd7;
5. c3 f6; 6. Qh5+ g6; 7. Qxg6+ hg; 8. Bxg6#

Nov 23 '06 #8

Old Wolf wrote:
dc*****@connx.c om wrote:
bi****@gmail.co m wrote:
have discovered (asurprise for me) that it is also the worldsmallest
chess program written in C language.It has a size of 3004 bytes, or
2261 bytes
It's not the smallest C chess program in the world.
http://home.hccnet.nl/h.g.muller/max1.html

That page says that its software doesn't even implement
the rules of chess properly .. I don't think that counts
However this version does.

http://home.hccnet.nl/h.g.muller/max-src2.html

and at 2000 bytes is still smaller.

-William Hughes

Nov 23 '06 #9


William Hughes ha escrito:
Old Wolf wrote:
dc*****@connx.c om wrote:
bi****@gmail.co m wrote:
have discovered (asurprise for me) that it is also the worldsmallest
chess program written in C language.It has a size of 3004 bytes, or
2261 bytes
>
It's not the smallest C chess program in the world.
http://home.hccnet.nl/h.g.muller/max1.html
That page says that its software doesn't even implement
the rules of chess properly .. I don't think that counts

However this version does.

http://home.hccnet.nl/h.g.muller/max-src2.html

and at 2000 bytes is still smaller.

-William Hughes
My program is still the world smallest chess
program, as it does all legal chess moves (the
other program cannot promote to knight, bishop
or rook).

As a bonus it includes messages for the current
score, stalemate and checkmate and a good board
display for the user's benefit.

Is very possible to cut all those "extras" and
leave a bare chess engine, getting it far below
the actual size of 2044 IOCCC characters (characters
minus spaces, and } { ; followed by space).

But I leave that as an exercise for the readers. ;)

About the random generator, is easy to add a
*NIX only srand(getpid()) ; at the program start.

Regards,
Óscar Toledo G.
http://www.biyubi.com/

Nov 23 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.