Open therealsterlingberger opened 1 year ago
Hi @therealsterlingberger, I'm happy you're enjoying the challenge! That's a bit mysterious, I tried writing the same code:
ulong blackPawnAttacks = BitboardHelper.GetPawnAttacks(new Square("b4"), false);
BitboardHelper.VisualizeBitboard(blackPawnAttacks);
Console.WriteLine(blackPawnAttacks); // 327680
and am getting the correct values. Is there any chance you've just mixed up which value you're printing out? If not, please post your full code here and let me know what version of the project you're using.
Hey there, thanks for the quick response,
it seems the issue has resolved itself by me not being braindead for coding the entire day, seems to work fine now. I will do some more debugging and try different positions and will close the issue after that if nothing new comes up.
Sorry for the inconvenience!
My best guess @therealsterlingberger is that you were mixing up true and false for "isWhite".
Hi,
I ran into an issue using BitboardHelper.GetPawnAttacks(Square square, bool IsWhite).
Shortform: The result of
BitboardHelper.GetPawnAttacks(new Square("b4"), false)
== 21474836480 == c5 & a5 which is wrong for a black pawn on b4 (parameter false). The result ofBitboardHelper.GetPawnAttacks(new Square("b4"), true)
== 327680== c3 & a3 which would be correct for a black pawn on b4 but uses the wrong parameter.Is there something wrong with the function or do I get it wrong?
According to documentation: GetPawnAttacks(Square square, bool isWhite) > Gets a bitboard of squares that a pawn (of the given colour [in my case black]) can attack from the given square.
Thanks, hadn't had this much fun coding in quite a long time!