Strryke / betafish

A chess engine and AI move finder written in Javascript. Beats Stockfish level 6 on Lichess.
https://betafish.gavinong.com
MIT License
95 stars 10 forks source link

makeAIMove doesn't make move #4

Closed MichaelYoon-rgb closed 1 year ago

MichaelYoon-rgb commented 1 year ago

Issue: Upon calling game.makeAIMove on a game with FEN of rrrrkrrr/rrrRrrrr/8/8/8/8/RRR1RRRR/RRRRKRRR b Qq - 0 0 It results in the variable bestMove to be 0 in the function. You can test this on the betafish.js website where after you set the FEN when you click "AI Move" nothing happens and no pieces are moved.

After digging, I found that the early return was due to the time being exceeded in the CheckUp function. However I still don't know how to resolve this problem, and for the FEN above, increasing the time to 200s didn't resolve the problem

MichaelYoon-rgb commented 1 year ago

Submitted pull request that fixed this issue.