Closed Mcmann283 closed 7 years ago
Without the rest of the code, I can't accurately predict what is happening. But, from the general structure, it appears that Continuations
, ListMoves
, and ForReply
are being stored (and maybe manipulated) outside of the Chess
class instance. Because of that, when the many variants of Chess
are being spawned (via .copy()
) by the Negamax AI, those variables are not changing in response.
I recommend that you store those three data structures inside the class. (self.Continuations
rather than global Continuations
.) If those data structures need manipulation by an outside library, have Chess
call those. You might have to pass references to that outside library into Chess
. I can only guess at the details, however.
Or better, place those three data structures inside the self.board
's PGN
class.
FYI, the .copy()
can be referenced in line 80 of easyAI/AI/Negamax.py
. link here
I would like to have some help adjusting possible_moves(self) and make_move(self,move) sections to work with chess. It seems that the Negamax algorithm
There has to be a way that I can keep possible_moves(self) and make_move(self,move) in sync with the way Negamax uses them in steps 1 through 4 above without the not-in-list error occurring because at some moment Negamax is checking a different branch of the tree and has a different self.board that it is using. I imagine that the solution can be easily spotted by someone more familiar with Negamax's nuances than I. I am grateful for any assistance. Here is the code and its print out.
The Code
Its Print Out