Wednesday, 25 February 2015

Week 7

Check week 6 for Object-Oriented-Programming

We've started assignment 2 before reading week. At first, this assignment looked pretty overwhelming compare to the previous assignment, because not only we are making a harder game than Subtract Square, but also we are implementing a much smarter AI for the game.

I started by reading the assignment instruction and the starter code several times. I found out that out of the four python files we need to write, game_view should be just a matter of changing/adding a couple of lines, and tippy_move is pretty short and straight forward. The real challenge comes from tippy_game_state and minimax.  The game state just needs a lot of work, such as checking if a tippy is formed, and draw the ascii version of the game board. The starter code for the subtract square game state class differs a lot from my code in assignment one, especially in terms of the way to approach the question, thus I had to change my way of thinking.

Minimax is the method that requires a bit of thinking; before coming to this class, I thought it would be really hard to make an AI that plays a perfect game. Now that I think about it, if you are able to list all the possible variations of the game, then the computer would be able to find the winning strategy. The downside is that the computer will take too long to make a move since number of possible variations are enormous in most of the games.  Still, recursion is needed for finding all the variations, and finding the perfect winning strategy based on all the variations isn't all that straight forward.

No comments:

Post a Comment