abassibe / Gomoku

2 stars 0 forks source link

Fix the way bitboards are assigned to players #58

Closed demonoidv closed 3 years ago

demonoidv commented 3 years ago

This PR should fix the famous soft-lock we can experience when the AI tries to play an illegal move.

The problem was that when we assign the bitboards the Python gives us, we do it wrong and invert player and opponent, so, the computation of the illegal moves in the Rust part was totally broken because base on the wrong board (the one of the human player while we were trying to get the illegal move for the AI).

This PR invert the assignation of the two bitboard to make things right, but now the AI seems to be stupid (I have to rework the heuristics scores, it will be part of a dedicated PR) with a depth of 5, but quite efficient with a depth of 1.