Portfolio Project 3: Python Scripting

For the third porfolio project, the goal was to create a tic tac toe game. This project was challenging but rewarding seeing the completed project.

Game Screenshot

The end goal for this project was to create a CLI game of tic tac toe. As with all the portfolio projects, this project was fairly open ended on how I wanted to achieve this goal. Some of the concepts that were touched on working with this project include object-oriented programming, importing modules, and working out game logic. This project was started off by creating a rough sketch of the flow I wanted to use for the game:

  • Initializing the board
  • Picking symbols
  • Who goes first
  • Determining a winner
  • Determining a tie
  • Adding replayability to the game

This project was definitely more challenging than the morse code project.

The two main challenges that I encountered were adding replayability with loops as well as making my code more concise and more efficient.

Starting with replayability, I was able to code a single game of tic-tac-toe, however, when trying to start a new game I really struggled to get it to exit the loop I created to prompt the user to play a new game. If an answer of no was entered for playing a new game, the game existed without any issues. However, when selecting yes, I was unable to get the prompt to exit and start a new game. I tried running the code through Thoney, and the VS Code debugger, but was unable to pinpoint the issue. This in part went hand and hand with my second challenge, a significant amount of my code was on my main.py file and there were several parts that could have been made more efficient using OOP.

As for making my code more efficient and concise, I originally wanted to code out as much as possible and get the program working. After that, my goal was to shift to optimizing and making the code more efficient. Since I was unable to pinpoint, the issue with replayaiblity, I decided I was going to restart this project and incorporate OOP from the get-go and start smaller. Using OOP, I was able to eliminate several repeating elements. For example, with there being two players, I initially had separate methods for symbol placement on the board and finding winning combinations. This was narrowed down to having individual methods for board placement and win checking. Ultimately, I still ran into being unable to start a new game, but with my code being more streamlined, I was able to identify the bugs in my program more easily and correct them!


This was a fun project to complete! All in all, the project was completed over the course of 2 and a half days but could have been completed in a single day had I not run into the hurdles I ran into. I had decided to dedicate my whole effort into completing this project. Since I have not worked with some of the concepts since earlier in the course, this project took a bit more of jogging my memory, but I was able to complete this project and I am more than satisfied with the result!