For a limited time, two sources

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

For a limited time, two sources

Post by sje »

Tar file source for CookieCat, a simple chess program in Pascal:

Code: Select all

https://dl.dropbox.com/u/31633927/CookieCat.tar
Tar file source for myopic, a simple chess program in C++:

Code: Select all

https://dl.dropbox.com/u/31633927/myopic.tar
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: For a limited time, two sources

Post by mcostalba »

Thanks for sharing !

Nice to read, although I wouldn't call it "simple" ;-)

Code: Select all

      86 text files.
      86 unique files.                              
       1 file ignored.

http://cloc.sourceforge.net v 1.53  T=0.5 s (170.0 files/s, 29216.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C++                             47           2190           1151           7438
C/C++ Header                    38            978            507           2344
-------------------------------------------------------------------------------
SUM:                            85           3168           1658           9782
-------------------------------------------------------------------------------


If myopic is simple then Stockfish is just a little toy:

Code: Select all

      42 text files.
      42 unique files.                              
       0 files ignored.

http://cloc.sourceforge.net v 1.53  T=0.5 s (84.0 files/s, 25020.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C++                             20           2161           1672           5876
C/C++ Header                    22            644            591           1566
-------------------------------------------------------------------------------
SUM:                            42           2805           2263           7442
-------------------------------------------------------------------------------
User avatar
pocopito
Posts: 238
Joined: Tue Jul 12, 2011 1:31 pm

Re: For a limited time, two sources

Post by pocopito »

Thank you Steven.

I also was a bit shocked when I gave a look at myopic code: maybe by "simple" you were referring to its strength? (no ofence intended).
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: For a limited time, two sources

Post by lucasart »

mcostalba wrote:Thanks for sharing !

Nice to read, although I wouldn't call it "simple" ;-)

Code: Select all

      86 text files.
      86 unique files.                              
       1 file ignored.

http://cloc.sourceforge.net v 1.53  T=0.5 s (170.0 files/s, 29216.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C++                             47           2190           1151           7438
C/C++ Header                    38            978            507           2344
-------------------------------------------------------------------------------
SUM:                            85           3168           1658           9782
-------------------------------------------------------------------------------


If myopic is simple then Stockfish is just a little toy:

Code: Select all

      42 text files.
      42 unique files.                              
       0 files ignored.

http://cloc.sourceforge.net v 1.53  T=0.5 s (84.0 files/s, 25020.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C++                             20           2161           1672           5876
C/C++ Header                    22            644            591           1566
-------------------------------------------------------------------------------
SUM:                            42           2805           2263           7442
-------------------------------------------------------------------------------
less is more!

Only 7442 lines of code for Stockfish, and that's accounting for:
- the brace style you use (with K&R style you'd count a lot fewer lines CLOC)
- the fact that SF has some code that ELO-useless code (Polyglot book management which is normally a GUI's job, KPK bitbase which is typically a < 5 elo gain if that)

Stockfish is by far the best ratio ELO / lines of code the world has ever seen :D
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: For a limited time, two sources

Post by sje »

I should mention that the myopic program was written as a demonstration of the Arduino development environment and is targeted towards the Arduino Mega platform. This platform uses an inexpensive AVR microcontroller with only eight MB RAM.

Myopic also runs in a regular desktop/notebook terminal emulator environment with the same features plus the ability to make an opening book.
User avatar
pocopito
Posts: 238
Joined: Tue Jul 12, 2011 1:31 pm

Re: For a limited time, two sources

Post by pocopito »

In the elo/line I guess it should be noted Sungorus: 1909 lines of a quite understandable C code, with an elo around 2400.
And an eval.c file of only 70 lines!
Two first meanings of the dutch word "leren":
1. leren [vc] (learn, larn, acquire) acquire or gain knowledge or skills.
2. leren [v] (teach, learn, instruct) impart skills or knowledge to.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: For a limited time, two sources

Post by Evert »

lucasart wrote: Stockfish is by far the best ratio ELO / lines of code the world has ever seen :D
I don't know, I suspect microMax has a strong claim there as well. Almost certainly better than Stockfish, since it's ELO/lines is actually larger than 1. :P
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: For a limited time, two sources

Post by Adam Hair »

Evert wrote:
lucasart wrote: Stockfish is by far the best ratio ELO / lines of code the world has ever seen :D
I don't know, I suspect microMax has a strong claim there as well. Almost certainly better than Stockfish, since it's ELO/lines is actually larger than 1. :P
Yeah. The ratio of characters to Elo for MicroMax is close to 1.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: For a limited time, two sources

Post by Evert »

Evert wrote:it's
ARGH!
:oops:
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: For a limited time, two sources

Post by Rein Halbersma »

Evert wrote:
Evert wrote:it's
ARGH!
:oops:
who care's? :wink: