Sorry, now I'm lost. I don't understand your alphaBeta search any longer. It is too unusual for my eyes and my brain.flok wrote:Well, it can be a matter of convenience. E.g. to be able to do a simple compare so that I can either use the "regular shannon" (for the opponent moves) and my own "enhanced shannon" (for the moves my engine performs).Sven Schüle wrote:When not using minimax any longer you also don't need to know the color of the moving side at the root node at arbitrary nodes in the tree. You should choose a name that reflects the semantics, also to avoid introducing new bugs.
Could you please explain the meaning of "moves are calculated" and of "sees which are determined"?flok wrote:It validates all of them. So I do a move, then automatically all possible moves are calculated and then that validate command sees which are determined.One more point: what exactly is the purpose of your "validateMoves()" method? In the snippet above you use it right after making a move. Does it validate (I guess: check legality of) ONE move, or ALL moves?Code: Select all
Scene::Move(Move move) { return new Scene(move); } // constructor Scene::Scene(Move move) { // execute move // calculate moves that white and black can do } Scene::validateMoves(PlayerColor color) { // validate the moves for player 'color' }
Oh that is an historical thing. I could move it in to the top of alphabeta but it would not give a direct gain. Maybe easier to read for outsiders but the program is not ready for opensourcing anyway.A second question: why does that "validateMoves()" call appear at that point in the search instead of appearing above the move loop (possibly implying few other changes)?
When making a move M1 (you do it by copying the current position - "Scene" - and then modifying the copy, which is o.k. for me), why do you immediately calculate which moves are possible "for white and black" from the new position? Only one side can make moves in the new position. And furthermore, instead of generating moves immediately, the first thing you have to do is check whether the previous move that led to the current position was actually legal (unless you follow the "king capture" legality checking strategy, where you have to do something different). If it wasn't legal then don't bother with generating moves or even searching them, but skip the current move M1 and continue with the next move M2 of your move loop.
Sven