Computer Chess Club Archives


Search

Terms

Messages

Subject: lines that I do not understand in ReadPgn of crafty

Author: Uri Blass

Date: 08:24:21 09/08/04


1)if (strchr(input_buffer,'\r')) *strchr(input_buffer,'\r')=' ';

What is the meaning of \r?

I see Carriage return in the help file but it does not help me much because I do
not understand what is carriage return when it is clear that is not a new line

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

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

I want to have a function to understand pgn file and I do not like to try it by
copying something that I do not understand but I also do not want to try it by
doing something based on my understanding because I am afraid that my
understanding is wrong and even if I do not see why Crafty does something there
is a reason to do it.

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

[Event "F/S Return Match"]
[Site "Belgrade, Serbia JUG"]
[Date "1992.11.04"]
[Round "29"]
[White "Fischer, Robert J."]
[Black "Spassky, Boris V."]
[Result "1/2-1/2"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3
O-O 9. h3 Nb8 10. d4 Nbd7 11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15.
Nb1 h6 16. Bh4 c5 17. dxe5 Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21.
Nc4 Nxc4 22. Bxc4 Nb6 23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7
27. Qe3 Qg5 28. Qxg5 hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33.
f3 Bc8 34. Kf2 Bf5 35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5
40. Rd6 Kc5 41. Ra6 Nf2 42. g4 Bd3 43. Re6 1/2-1/2


I am not sure about clear instructions where the rating should appear and I do
not like to read all the content of the link that I  gave espacially when I am
not sure that there is information about the rules of wring rating.

Uri



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.