SebLague / Chess-Challenge

Create your own tiny chess bot!

Home Page:https://www.youtube.com/watch?v=Ne40a5LkK6A

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Black pawn appearing on h4

adamdougall opened this issue · comments

Black pawns appear to be able to spontaneously appear on h4 when using MakeMove.
For some reason I also get different output using FenUtility.CurrentFen with bool = true or false

Here is my code with WriteLines added for debugging:

        Console.WriteLine(algebraicMove);

        //convert algebraicmove type string to type ChessChallenge.Chess.Move
        Move move = ChessChallenge.Chess.MoveUtility.GetMoveFromSAN(board, algebraicMove);

        Console.WriteLine(FenUtility.CurrentFen(board, false));
        Console.WriteLine(board.Square[31]);

        // Apply the move to the new Board
        board.MakeMove(move, true);

        Console.WriteLine(FenUtility.CurrentFen(board, false));
        Console.WriteLine(board.Square[31]);
        Console.WriteLine(FenUtility.CurrentFen(board, true));
        Console.WriteLine(board.Square[31]);

And what my console displays:

O-O
r1bqk2r/pp1pnppp/8/P2pP3/8/B2Q1N2/5PPP/R4RK1 b kq - 0 11
0
r1bq1rk1/pp1pnppp/8/P2pP3/8/B2Q1N2/5PPP/R4RK1 w - - 1 12
9
r1bq1rk1/pp1pnppp/8/P2pP3/7p/B2Q1N2/5PPP/R4RK1 w - - 1 12
9