0

For the given fen string -

k7/1R1RN3/p3p3/P3P2p/1PP4P/3K1PP1/8/8 b KQkq h3 0 1

Chess.js does not detect and show chess.moves() gives you ['0-0-0'], which is queen side castling, Not possible without a queen.

Any idea?

manlio
  • 18,345
  • 14
  • 76
  • 126
Hardeep Mehta
  • 469
  • 1
  • 6
  • 17
  • Maybe queen side castling without a queen is a code for stalemate? :) – Kaz Aug 31 '16 at 04:46
  • Haha, I guess, then .in_stalemate() or .in_draw() should return true, – Hardeep Mehta Aug 31 '16 at 04:47
  • "Queen side castling" is a move involving king and rook, it is quite possible without a queen – M.M Aug 31 '16 at 04:55
  • Can you please check the fen string and see why is it not being detected? – Hardeep Mehta Aug 31 '16 at 04:57
  • @HardeepMehta the fen string is OK, if you have described the situation accurately then it would be a bug in "chess.js" – M.M Aug 31 '16 at 04:58
  • consider posting on chess.stackexchange.com instead , as posted this is not really a question for StackOverflow. If you want to report a bug in some library then use their support channel. – M.M Aug 31 '16 at 05:02

1 Answers1

1

Turns out to be a problem with the fen string, The castling flags were not set right!

The fen should be :

k7/1R1RN3/p3p3/P3P2p/1PP4P/3K1PP1/8/8 b - h3 0 1

Hardeep Mehta
  • 469
  • 1
  • 6
  • 17