Our biggest challenge this week was the assignment two that was due Thursday. In-comparison to assignment one, the assignment two was much more "demanding" I would say. Especially the computer strategy. In the subtract square assignment, we were able to simply import random and use the randint function to help us achieve our objective. Where as this time we had to actually write our own function called minimax. Beyond that, assignment two tippy games was based on the concept of tic-tac-toe. However, much more complicated as the winning conditions had variations in-comparison to tic-tac-toe.
At first it wasn't hard to come up with a viable plan for the minimax function. However it was much more easier said than done. We had zero clue how to achieve such a complex algorithm of calculation. Due to stress, my group had a dispute over 2 ideas of whether to set the game board as a dictionary of ints where each integer represents each square on the game board. Or to perhaps set coordinates instead.(x-axis and y-axis) After hours of debate, we decided to go with the simpler method. To set the game board as a dictionary and have all the check on the game board represented by an integer as the key of the dictionary in order to keep track of the game state.
Moreover, just as we though we were about to finish. We've encountered an other problem and that is the rough outcome method in the game state. And that was how round two of the dispute begun. One of my teammate came up with a brilliant idea of comparing the amount of the potential winning conditions each player had.(counting the 3 connected pieces of similar chess, basically the conditions which only requires 1 more move to win) And the player with the most 3 connected pieces obviously has a higher chance of winning the game.
After experiencing this extremely difficult assignment, I can't wait to see what assignment three would be like. Hopefully I won't look like this.

No comments:
Post a Comment