I recently completed my final project of CS101 in my progression through the Codecademy Computer Science career path. It required an interactive program using input features, the use of Git version control, and ideally implemented as much as the content as I had covered up until that point.
I decided to write a simple code allowing the user to play a game of Tic Tac Toe, accepting input allowing the user to choose where to place their 'X' or 'O'. The initial attempt included exclusively my own work, conducting research on syntax as I required it. I managed to pull together a basic version that accepted input, limited the total turns to 9, and found a winner. It did have a number of limitations:
- error produced when entered text did not match 1-9
- player unable to choose 'X' or 'O'
- did not have a computer player
I sourced a model set of code searching on the internet, and compared it with my own. There were clear similarities, which meant that I was on the right path. The model I found had included a number of additional functions, with the most notable being a computer player.
Using the model as a guide, I attempted to re-write my own code using the new concepts, which solidified a number of concepts including:
- using randomly generated numbers
- producing computer responses
- using boolean functions like is_board_full
I did have a number of issues re-implementing the code, particularly with calling the user input as integers, and ultimately was not able to successfully run my own modified version of the model, but it did provide a great learning opportunity.
Link to GitHub: https://github.com/0xTomas/CS101-Final-Project
Top comments (0)