For the past two
weeks, I have been working on assignment 2. This assignment is in a way an
extension of assignment 1 because we are working with the same classes (Gamestate,
Gameview, Move, Strategy). However, the game Tippy is more complicated than
Subtract Square (referred as SS). For example, there are different situations
the game Tippy can end, while SS can only end with the number being 0. Also Tippy
can end in a tie, another new condition that needs to be considered.
I did not encounter
any major slumps while working on class TippyGameState and class TippyMove. Most
of the functions are straightforward and very similar to those in assignment 1.
One tip I noticed is the importance to come up with a plan first before
starting coding. In this case, it was important to know how I was going to
represent the squares on the board. I chose to use coordinates in the form of
tuples, and several important functions were dependent on this choice.
In the past few days
I was stuck for the longest time on class Minimax. There were two problems that
I could not solve for my suggest_move function to work properly. The first was
to return an available move at the state. Since the suggest_move function uses
recursion and calls upon itself, the move that it analyzes when it calls on
itself is a move in the next step. Eventually, the move it will return is that
in the final step it analyzes. The other problem lies in the scores 1 and -1
that are assigned to each player in each state of the game. When the function
uses recursion and analyzes the next state, the state.next_player variable
switches, and the scores should be flipped. As of now, we have not found a way
to implement this into our code.
There is still three
days left until the assignment is due. With all other parts of the assignment
done, I am positive that we can come up with a way to implement class Minimax.
No comments:
Post a Comment