When a somewhat optional item takes longer than it should

Posted by Anna (Raiet) Intraub on January 28, 2018

For the Final Project Tic Tac Toe with AI, there were a lot of parts that were simple and a lot of parts that were harder. It was kind of interesting to go back to the previous Tic Tac Toe labs and then transform many of the functions to fit with the new modular structure. As the project incorporated many different aspects of the various features and functionality learned, it was definitely a great mix.

The most problematic part of the project for me was the AI computer. Thanks to a large sample of AIs in mainstream media, it was pretty easy to think about how smart I would like the AI to be. It was also pretty easy to put together some pseudocode in how exactly the AI could go about being that smart (suffice to say it included the word “learning” a lot). That’s when I hit a wall. Of course, the pseudocode made sense and there were parts that I could actually code with limited help. But then I realized that the feature was getting a lot more complicated than I really wanted, and it felt a lot like scope creep.

Once I realized that I’d spent an inordinate amount of time trying to think my way through the problem, I decided to simply start over and build from the ground up. First the AI needed to be smart enough to not move over past moves. Then my ideas split into two portions: an offensive AI and a defensive AI. There is the saying “a good defense is a good offense” and maybe vice versa? Either way, I decided to at the very least get my AI to try and not lose. Admittedly, when I moved on to trying to make my AI be aggressive and try and win, my brain scrambled itself trying to account for the different variables. I spent several hours trying to get my AI to be both defensive and offensive before I decided that it fit the parameters and moved on. If there is one thing that I’ve learned from my programming work in the past, sometimes you just have to give up on the ideal idea in favor of making the program fit the minimum requirements. Scope creep is a real thing, and even though I wasn’t able to get my AI to be as smart as I wanted it to be, I learned a lot in the process. After I learn even more and get more experienced in Ruby, I can always come back to the idea and try again.