This week, we finish assignment 2 which is a interesting game computation design. Actually, I did bad at Assignment 1 because I did not realize that this game design is a objected-oriented design. What I mean for the objected-oriented is basically the design frame of this assignment should be applied to any other similar games. For example, we have a general game state function which contains general game states and function such as whose turn it is, which move this player chose. What we write for this general function should not design for a particular game state, meaning, we should not use any parameter and function from a particular game class. The reason we do this is to build a frame of all the game so that every time we build a new game, we just follow this frame and design a subclass under this total class. This is quite useful and time saving in a real life design project.
Fortunately, I don't need to use my messy Assignment 1 to do the Assignment 2. In this assignment, we have a different object which is to build a new strategy - minimax. General idea of this strategy is simply, whatever is good for the opponent is a bad thing for me. It is kind of like game theorem that every move before choosing the move, we have to compare each legal move so that we can get a move that benefits us mostly. To do this, algorithm minimax is a recursive function that kind of computes each move alternatively starting from current player, and return the best move. With this algorithm, we can get a move that relatively good.
No comments:
Post a Comment