This week in class we mostly discussed our second assignment and binary trees. I feel pretty confident with binary trees, and I think that the discussion of assignment helped me to get some insight into what I was supposed to do. Nonetheless, some things remain quite unclear. For instance, I still cannot get what the rough_outcome method in the TippyGameState class is supposed to do. Looking at its alternative in the subtract square game state I came to a conclusion that it's supposed to evaluate the outcome of yet unfinished game. The mechanism of work is pretty straightforward for subtract square, but things got really weird when I started to design it for tippy. To begin with, the only ultimately winning condition for the player I could think of, was an almost completed tippy. Of course, it was not easy to make computer find such a tippy on the board, and many lines of ugly code were created for this purpose. Another thing is that I couldn't make up any ultimately losing conditions, except for the one in which opponent has already formed a tippy, which is weird, as in this case game will be over. However, when I started implementing code for the strategy, I realized that, maybe, I should have implemented this function using some method which would list all possible outcomes of the game, and then evaluate this list to find rough outcome at certain point. On the other hand, it would have linked rough_outcome to the minimax strategy pretty tightly.
Another idea I struggle with while working on assignment is minimax strategy itself. It took me an entire day to get a slight idea of what should be happening in that piece of code. And when I finally found a way to make computer list all possible outcomes of a single move, it returned me an insanely nested list with, literally, thousands of items. It wouldn't be that bad (list was expected to be long and nested, as there are many possible outcomes of the game), if there was at least one -1.0 result on that list. Unfortunately, I could only see 1.0 and 0.0. Still, I guess, I need to improve that function or test it with more examples. Hopefully, I will eventually make it work and suggest_move will finally return the best possible move.
To conclude, most of this week was dedicated to writing an assignment, and I have a lot of impressions about it. I hope that I will manage to complete and submit it on time. Yet, I am feeling pretty insecure about this work.
No comments:
Post a Comment