reset password
Author Message
mkuko
Posts: 13
Posted 16:01 Sep 22, 2019 |

I may be missing something simple here but I'm having a hard time understanding what the value for each board state is.

Specifically the val that is supposed to be returned from the function minimax(self, board) along side the move and game_length variables.

rabbott
Posts: 1649
Posted 16:24 Sep 22, 2019 |

minimax returns: (move, (value, game_length)).

move is the move to make to achieve the optimal result. That optimal result is composed of two parts.

value is the value of the game: 100 if X wins; 0 if it's a tie; -100 if O wins. (The optimum value will differ depending on whether the player is X or O.)

game_length is the length of the game. If two moves achieve the same optimal value, the one with the longer game is better.

mkuko
Posts: 13
Posted 16:31 Sep 22, 2019 |

Great, thank you for the clarification.

sdo8
Posts: 54
Posted 18:57 Sep 23, 2019 |
rabbott wrote:

minimax returns: (move, (value, game_length)).

move is the move to make to achieve the optimal result. That optimal result is composed of two parts.

value is the value of the game: 100 if X wins; 0 if it's a tie; -100 if O wins. (The optimum value will differ depending on whether the player is X or O.)

game_length is the length of the game. If two moves achieve the same optimal value, the one with the longer game is better.

 

I am assuming we are allowed to change the value of the game (EX: Return 100 + additional depth on win state) to prioritize moves that result in additional expansions (or more children)?

rabbott
Posts: 1649
Posted 22:36 Sep 23, 2019 |

Right. All _makeAMove has to do is return a move. It uses minimax, but how minimax does its job is up to you.