I think you can improve it a lot by taking into account its own position. I mean, moving forward isn't very important want you are under the menace of a checkmate somewhere else.
I think you can improve it a lot by taking into account its own position. I mean, moving forward isn't very important want you are under the menace of a checkmate somewhere else.
But if you intentionally hang your pieces, it tends to take them. And it will try to promote pawns in the endgame. So it is possible for it to stumble upon a checkmate, though in my effort where I gave away all my pieces, it instead found the only move to stalemate once it had K+Q+R vs K.
Chose the most aggressive move (in term of pieces value and check-mate), if none is aggressive, it takes on of the move equally non aggressive.
Didn't remember the depth of the algorithm but it was very simple C code, could check quickly. It should be able to find a mate in 2 or 3 if it was in position of having one.
I didn't check the correctness of the algorithm, just the intention.
I applaud the effort but not sure I see the point, I had a more capable chess playing program than this on a zx speccy in the 80’s.