Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEN tag is lost in game.ToString() #19

Open
oulenspiegel opened this issue Dec 7, 2016 · 4 comments
Open

FEN tag is lost in game.ToString() #19

oulenspiegel opened this issue Dec 7, 2016 · 4 comments

Comments

@oulenspiegel
Copy link

PGN example:

[Event "Arena Tournament"]
[Site "MARKOVPC"]
[Date "2016.11.21"]
[Round "1"]
[White "R2459"]
[Black "R2454"]
[Result "1/2-1/2"]
[BlackElo "2700"]
[Time "05:20:14"]
[WhiteElo "2700"]
[TimeControl "15+0"]
[SetUp "1"]
[FEN "1k1r1bnr/pppq1ppp/2n1p3/8/Q1pP2b1/2N2NP1/PP2PPBP/R1B2RK1 w - - 0 1"]
[Termination "normal"]
[PlyCount "137"]
[WhiteType "program"]
[BlackType "program"]
[Comment ";"]

  1. e3 {(e2-e3 Bg4xf3 Bg2xf3 Nc6-b4 Qa4xd7 Rd8xd7 Nc3-e4 Ng8-f6 Ne4xf6 g7xf6
    Bc1-d2 Nb4-d3 b2-b3 c4xb3 a2xb3 Bf8-b4 Bd2xb4 Nd3xb4) -0.12/12 0} Bxf3
    {(Bg4xf3 Bg2xf3 Nc6-b4 Qa4xd7 Rd8xd7 Nc3-e4 Ng8-f6 Ne4xf6 g7xf6 Bc1-d2
    c7-c5 Ra1-c1 b7-b5 Bd2xb4 c5xb4 Bf3-c6) +0.28/13 0} 2. Bxf3 {(Bg2xf3 Nc6-b4
    Qa4xd7 Rd8xd7 b2-b3 c4xb3 a2xb3 Ng8-f6 Nc3-e4 Nf6xe4 Bf3xe4 Nb4-d5 Bc1-d2
    Bf8-b4 Bd2xb4 Nd5xb4) -0.29/13 0} Nb4 {(Nc6-b4 Qa4xd7 Rd8xd7 Nc3-e4 Ng8-f6
    Ne4xf6 g7xf6 Bc1-d2 Nb4-d3 b2-b3 c7-c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6 Kc3-c4 Kf6-e5 Kc4-c3 Ke5-f6
    Kc3-c4 Kf6-e5 Kc4-c3) 0.00/32 0} Re8 {(Re3-e8 Rf4-f7+ Kd7-e6 Rf7-b7 Re8-d8+
    Kd4-c3 Rd8-e8 Kc3-d3 Re8-d8+ Kd3-e2 Rd8-e8 Ke2-d3 Re8-d8+ Kd3-e2 Rd8-e8
    Ke2-d3 Re8-d8+ Kd3-e2 Rd8-e8 Ke2-d3) 0.00/45 0} 68. Re4 {(Rf4-e4 Re8xe4+
    Kd4xe4 Kd7-e6 Ke4-e3 Ke6-d5 Ke3-f4 Kd5-c4 Kf4-e5 Kc4-c3 Ke5-f6 Kc3-c4
    Kf6-e5 Kc4-c3 Ke5-f6 Kc3-c4 Kf6-e5 Kc4-c3 Ke5-f6 Kc3-c4) 0.00/39 0} Rxe4+
    {(Re8xe4+ Kd4xe4 Kd7-c7 Ke4-e3 Kc7-d7 Ke3-d3 Kd7-c7 Kd3-e3 Kc7-d7 Ke3-d3
    Kd7-c7 Kd3-e3 Kc7-d7 Ke3-d3 Kd7-c7 Kd3-e3 Kc7-d7 Ke3-d3 Kd7-c7 Kd3-e3)
    0.00/38 0} 69. Kxe4 {(Kd4xe4 Kd7-e6 Ke4-e3 Ke6-d5 Ke3-f4 Kd5-c4 Kf4-e5
    Kc4-c3 Ke5-f6 Kc3-c4 Kf6-e5 Kc4-c3 Ke5-f6 Kc3-c4 Kf6-e5 Kc4-c3 Ke5-f6
    Kc3-c4 Kf6-e5 Kc4-c3) 0.00/1 0 Insufficient material} 1/2-1/2
@oulenspiegel oulenspiegel changed the title FEN tag in game.ToString() FEN tag is lost in game.ToString() Dec 7, 2016
@Antaniserse
Copy link

I just noticed also another issue with the FEN tag: if you access the value from the Game.Tags dictionary, instead of getting the original string, you seem to get the ASCII diagram of the board... in the example above, Game.Tags("FEN") returns

---------------------------------
| R |   | B |   |   | R | K |   |
---------------------------------
| P | P |   |   | P | P | B | P |
---------------------------------
|   |   | N |   |   | N | P |   |
---------------------------------
| Q |   | p | P |   |   | b |   |
---------------------------------
|   |   |   |   |   |   |   |   |
---------------------------------
|   |   | n |   | p |   |   |   |
---------------------------------
| p | p | p | q |   | p | p | p |
---------------------------------
|   | k |   | r |   | b | n | r |
---------------------------------

@Antaniserse
Copy link

Antaniserse commented Dec 8, 2016

I really am not skilled in F#, so i might be completely misunderstanding the code, but I think the idea was to add an additional custom tag to keep the ASCII diagram (given by boardSetup.toString()), that was intended to be filtered out by the game.toString() method, to show only the actual tags of the game/file

It has been, however, added in the dictionary by mistake using the "FEN" name, instead of some arbitrary new one, and thus it overwrites the standard FEN tag

@sayedihashimi
Copy link

I just noticed also another issue with the FEN tag: if you access the value from the Game.Tags dictionary, instead of getting the original string, you seem to get the ASCII diagram of the board

I am seeing the same thing

@Antaniserse
Copy link

Antaniserse commented Jan 5, 2018

This is a very crude patch, and it only fixes the Game.Tags dictionary, not the Game.ToString() issue, but it gets the job done for what I'm doing, so in case someone find it usefull too, here it is:

In Pgn.Data.BoardSetup.cs replace .ToString() with:

public override string ToString()
        {
            string output = "";

            Piece piece;
            string row,pieceStr,castleStr,epStr;
            int emptySquares;

            for (int iRank = 0; iRank < 8; ++iRank)
            {
                row = "";
                emptySquares = 0;
                for (int iFile = 0; iFile < 8; ++iFile)
                {
                    piece = this[iFile, iRank];
                    if (piece == null)
                    {
                        emptySquares += 1;
                    }
                    else
                    {
                        if (emptySquares > 0) row += emptySquares.ToString();
                        pieceStr = PieceToString(this[iFile, iRank]);
                        row += pieceStr.Trim();
                        emptySquares = 0;
                    }
                    if (iFile > 0 & iFile % 7 == 0)
                    {
                        if (emptySquares > 0) row += emptySquares.ToString();
                        output += row;
                        if (iRank < 7) output += "/";
                    }
                }
            }

            if (IsWhiteMove)
                output += " w";
            else
                output += " b";

            castleStr = " ";
            if (CanWhiteCastleKingSide)
                castleStr += "K";
            if (CanWhiteCastleQueenSide)
                castleStr += "Q";
            if (CanBlackCastleKingSide )
                castleStr += "k";
            if (CanBlackCastleQueenSide)
                castleStr += "q";

            if (castleStr.Length > 1)
                output += castleStr;
            else
                output += " -";

            epStr = "-";
            if (EnPassantSquare != null)
                epStr = EnPassantSquare.ToString();
            output += " " + epStr;

            output += " " + HalfMoveClock.ToString();
            output += " " + FullMoveCount.ToString();

            return output;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants