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

Make up Slog for my Slacking

Hey everyone,

I want to start by apologizing for my absence. I know we computer scientist are lazy, but that is no excuse to not be posting! (We are lazy because we try to find the easiest way to do the hardest task) So here I am :)

I will talk about objects today. The recent why I want to talk about objects is because of my recent assignment. We worked with this "tippy" based game where the winner is whoever makes a "tippy" pattern in an n x n grid. How do objects intertwine with all of this? We had to do an object for a game instance where the status of that game is constantly being updated as the object it is. However, the interesting part was when I created a separate class for making moves within the game. I created a whole additional class that took a game instance as a parameter. I think I lacked this idea in my first assignment. With the help of the starter code provided in this assignment, I realized this idea of being able to manipulate these objects (gameinstances) using objects that take gameinstances as parameters.

But here is where I failed with the second assignment. I took the idea of making a class for making moves which takes a game instance, but I failed to do that for our minimax strategy. I should have better followed the instructions to see that this is what they were truly demanding when trying to apply minimax strategy. I will talk about my minimax experience in the following slog because that is a whole other ordeal.

If I was able to better understand that objects can easily take other objects as parameters, I would have been able to better fit the strategy into my game. That way I can just constantly update new gameinstance without accidentally creating a new game instance. The object at hand will be the only object that I will be working with.

Thank you,
your lazy computer scientist  -- Boris :)