Pre-March Madness:
Learning Python: My project included three parts: Learning Python, Creating the tic tac toe game, and then making the algorithm for it. I decided that the best way to use my two weeks of March madness is to use all of my time for the algorithm. This would mean that I need to learn Python and create the tic tac toe game before the first week. Before I started any code I watched a beginners python video(provided to me by my IP10 advisor). This gave me the knowledge to start on my code. The rest of my learning happened during the coding process.
Attempting to create my first tic tac toe game: While my first attempt showed that I was making progress, it was far from what I needed to do. I hardcoded all nine squares on the board and their inputs. Luckily I was only doing tic tac toe, because if I was doing chess, coding all 64 squares would have taken days. My initial process was very inefficient as it took double the amount of lines of code that it needed to, and it couldn't even tell if the players won or lost. Most importantly, my inefficient code would not allow me to implement an algorithm. If I was going to continue with my project I would have to revise my game.
Revising my tic tac toe game: While this code may look worse, it is much more efficient. It took significantly fewer lines of code, and it can track if a player won or lost. Also, as a replacement for the unbeatable algorithm, I made the computer make random moves. My code was ready for me to implement the algorithm. However, despite all the improvements, my text-based tic tac toe game would not be appealing to audiences. To fix this, I decided to use an addon called tkinter, which would allow people to use buttons instead of typing in coordinates to choose where the pieces go.
Converting from text to tkinter: tkinter is an addon to python that allows you to use a GUI in a seperate window rather than text. In the GUI you are able to add buttons that activate commands when pressed. I used in to display my tic tac toe game. I was now completely ready for my first march madness week.
March Madness week #1:
Researching the MiniMax algorithm: Just like my process for creating the tic tac toe game, I had to start with research. Here is what I learned about the MiniMax algorithm: The name minimax refers to the idea that computer wants to minimize ints opponents move and maximize its move. First, the computer searches through every combination of move until the end of the game and evaluates who wins, who loses, or if it is a draw. Then it goes backwards assigning number value to each move. It then picks the best move and waits for the opponent to play. What amazes me is that it can do all of that in less than a second.
Attempting to create the MiniMax algorithm: Just because I knew what the minimax algorithm was did not mean I knew how to implement it into my code. Throughout the week I looked at many different and tried many variations of the code, but I could not get it to function properly. Despite my efforts I was not able to complete it on my own by Friday.
Attempt #2: My MiniMax code was very close to being perfect. However, there were a few errors in my code that I was not able to discover that messed up the algorithms purpose. I had to get help from a tutor who helped me find my errors and I was able to get the algorithm to work.
March Madness week #2:
Recreating my project: I had worked really hard on my project to get it where it is now. However, because of the videos and articles that I used to help me, I was not 100% sure I could write my code without them. I could understand what every part of my code did, but I wanted to be an expert. I decided I would redo my project, using as little resources that I can.
Starting my presentation: Now that I was done with my project, I was finally ready to start thinking about my presentation. For future 10th graders, I would recommend to start thinking about your presentation early, because after the march madness weeks, the extra work from school can make the project really stressful.