DEV Community

Cover image for CS101 - Final Project, "Tic, tac but no toe!"
0xTomas
0xTomas

Posted on

CS101 - Final Project, "Tic, tac but no toe!"

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.

Image description

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay