For a limited time, two sources

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

For a limited time, two sources

Post by sje » Tue Jan 22, 2013 1:52 am

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 7:17 pm

Re: For a limited time, two sources

Post by mcostalba » Tue Jan 22, 2013 7:19 am

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: 234
Joined: Tue Jul 12, 2011 11:31 am
Contact:

Re: For a limited time, two sources

Post by pocopito » Tue Jan 22, 2013 8:31 am

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: 3023
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: For a limited time, two sources

Post by lucasart » Tue Jan 22, 2013 10:59 am

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 6:43 pm

Re: For a limited time, two sources

Post by sje » Tue Jan 22, 2013 2:04 pm

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: 234
Joined: Tue Jul 12, 2011 11:31 am
Contact:

Re: For a limited time, two sources

Post by pocopito » Tue Jan 22, 2013 3:24 pm

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: 2909
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: For a limited time, two sources

Post by Evert » Tue Jan 22, 2013 4:01 pm

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: 3199
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: For a limited time, two sources

Post by Adam Hair » Tue Jan 22, 2013 5:52 pm

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: 2909
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: For a limited time, two sources

Post by Evert » Tue Jan 22, 2013 8:05 pm

Evert wrote:it's
ARGH!
:oops:

Rein Halbersma
Posts: 682
Joined: Tue May 22, 2007 9:13 am

Re: For a limited time, two sources

Post by Rein Halbersma » Tue Jan 22, 2013 10:12 pm

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

Post Reply