Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Open Source Chess Programs

Author: Tord Romstad

Date: 02:32:18 06/08/05

Go up one level in this thread


On June 07, 2005 at 21:32:33, Pedro Castro wrote:

>Tord, how I can count the line number (code) of the program?,  some interface
>says it?

Hi Pedro,

I did this on a Macintosh, which runs a dialect of Unix.  In most Unices,
there is a simple command line utility called 'wc' (word count) which can be
used to count the number of lines, words and characters in a text file.  In
order to count the number of lines in Glaurung source code, I do this:

[romstad@europa] ~/sjakk/Glaurung4/0.2.4b > wc -l *.c *.h

Everything before the character '>' is just the command prompt.  I only
typed 'wc -l *.c *.h'.  The '-l' switch instructs wc to only count lines.
The output looks like this:

    163 attacks.c
     39 board.c
    158 book.c
     76 data.c
    380 endgame.c
    538 eval.c
     61 extend.c
     20 history.c
     74 init.c
    229 io.c
     16 main.c
    150 mersenne.c
    262 move.c
    375 movegen.c
     29 neweval.c
     76 order.c
     32 pick.c
     85 psq.c
    340 pstruct.c
    192 root.c
    270 safety.c
    385 search.c
    142 see.c
    120 strcase.c
     23 strength.c
     53 think.c
     30 timeoday.c
    103 tt.c
    152 uci.c
     44 zobrist.c
    499 glaurung.h
   5116 total

If I am only interested in the total number of lines, and not the number
of lines in each individual file, I can pipe the output of the 'cat' command
through wc:

[romstad@europa] ~/sjakk/Glaurung4/0.2.4b > cat *.c *.h | wc -l
   5116

I am sure there is something equivalent to wc in Windows as well, but the
name and syntax of the command may be different.

Tord



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.