colding10 / Kingfish

C++ UCI chess engine (2000 ELO)
GNU General Public License v3.0
4 stars 0 forks source link

Engine makes illegal rook move #12

Closed colding10 closed 1 year ago

colding10 commented 1 year ago

Describe the bug At position e2e4 b8c6 g1f3 g8f6 b1c3 d7d5 e4d5 f6d5 d2d4 d5c3 b2c3 e7e5 d4e5 d8d1 e1d1 c8g4 f1b5, the move a9d8 suggested by the engine is illegal. a9 is out of bounds.

To Reproduce Steps to reproduce the behavior:

  1. Run the engine
  2. Send command position startpos moves e2e4 b8c6 g1f3 g8f6 b1c3 d7d5 e4d5 f6d5 d2d4 d5c3 b2c3 e7e5 d4e5 d8d1 e1d1 c8g4 f1b5
  3. Send command go wtime 168235 btime 63208 movestogo 32
  4. See error

Expected behavior The rook moving is understandable. However, it should be a8d8.

Screenshots Screen Shot 2023-04-03 at 5 30 42 PM

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

colding10 commented 1 year ago

This issue has been patched. The issue was related to the way C++ handles modulo with negative signs, and floor division.