Author: GeoffW
Date: 09:48:14 09/08/04
Go up one level in this thread
Hi Uri
>1)if (strchr(input_buffer,'\r')) *strchr(input_buffer,'\r')=' ';
>
>What is the meaning of \r?
'\r' is the single character "carriage return" it is 13 decimal
'\n' is the single character "line feed" it is 10 decimal
Depending on what Application and what OS originally wrote the file in the first
place text lines might end \r\n, or \n, or \r, or \n\r.
>I also do not understand why there is checking for the case that a new line
>appears in buffer(Crafty does the same for "\n")
>
>It seems to me to be impossible when fgets was used to read input_buffer
fgets reads characters from the current stream position to and including the
first newline character, to the end of the stream, or until the number of
characters read is equal to n – 1, whichever comes first.
So it is possible that you get a string without a newline on the end if it the
end of the file or >= n.
>
>2)
>bracket1=strchr(input_buffer,'\"');
>if (bracket1 == 0) return(1);
>bracket2=strchr(bracket1+1,'\"');
>if (bracket2 == 0) return(1);
>
>I understand that bracket1 should be a pointer to the first appearence of
>\" but there is no explanation what \" means
\" is just C speak for the single character representing double speechmarks
it needs the slash in front so the compiler can understand it is not the start
of a string literal.
>3)I thought that one of the important things to know in pgn file may be the
>rating of the player but unfortunately I see no rating in examples of pgn file
>in http://www.ex.ac.uk/~dregis/DR/Standard.txt
There are 7 standard tags defined in the spec. ELO is not one of these 7
standard tags
ELO was allowed for as a supplemental tag, but I guess not used very often
9.1.2: Tags: WhiteElo, BlackElo
These tags use integer values; these are used for FIDE Elo ratings. A value of
"-" is used for an unrated player.
Regards Geoff
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.