First, we talked about how to get the apply_move right. In order not to change the GameState according to the type contract, a new method called deep copy was introduced. We use deep copy to make a copy at every level so that we won't inadvertently change the GameState.
Second, we did something about testing minimax. Basically the call looks like:
sm = StrategyMinimax() sm.suggest_move(SubtractSquareState(?, ?))
The important idea is that if one test case passes, it doesn't necessarily mean that the minimax worked well because there is a possibility that it can be passed by a random strategy too. So for example, we tried some test cases in the lecture. It turns out that some of the game state will lead a win for one person no matter what move he chooses. In this situation, minimax won't be tested effectively. However, some game state with some moves leading to a win and some moves leading to a loss is better because the player will certainly win if he uses minimax. When he chooses random move, he's not guaranteed to win or lose.
No comments:
Post a Comment