Monday, 9 March 2015

Week 7: MINI - MAX

Hey everyone,

Like I said in my lasts Slog, I will discuss minimax!

"Wow"... That is the expression I would use to describe minimax. The purpose of minimax is to find the best possible move for the computer to choose from when confronted with a certain game instance. The idea is that minimax will be called recursively till the game is over. At that point, one would be able to see who won and who lose and let that information be carried out of the recursive function. Depending on which move would produce a winning path, and which would produce a losing path, the computer would pick accordingly.

When I started working with Minimax, I believed that the recursive idea should be implemented not within the same definition function, but two that are constantly called upon one another till the base case (which is the game is over) is present. The first function is max which will determine that if the player at this certain gameinstance can make a move that will lead them to a gameinstance where the game is over. If the game is over who won. depending on who one +1 will be brought back if it is a winning score, a -1 if it is a losing store, and a zero if it is a draw. HOWEVER, if the new gameinstance does not produce a gamestate that is over, the mini function will be called. Likewise to max function this function will determine the exact same thing, but if the game instance that is produced is not a game over game state it will call on max function.

This recursive idea actually uses two functions that call each other recursively. I did have issues of keeping score because its so difficult to this that far ahead. However, some pen and paper does always help.

Overall, I do believe starter codes provided encourage the right ideas to be generated when working on these projects. Rather than diverting from the main ideas, the starter code provides an insight on how the problem should be approached.

Thank you again everyone!
Will make a few more slog's later tonight.
Hope for positive feedback,
Boris

No comments:

Post a Comment