4Geeks logo
4Geeks logo

Courses

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Coding Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Full-Stack Software Developer - 16w

Data Science and Machine Learning - 16 wks

Search from all Lessons


LoginGet Started
← Back to Projects

TicTacToe CLI with Python

Goal

4Geeks Coding Projects tutorials and exercises for people learning to code or improving their coding skills

Difficulty

easy

Repository

Click to open

Video

Not available

Solution video

Not available

Average duration

8 hrs

Technologies

Weekly Coding Challenge

Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!

Start the Challenge

Podcast: Code Sets You Free

A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.

Listen the podcast

You will practice:

  1. Python lists/arrays
  2. Creating a two dimensional matrix with Python
  3. Using the while loop to avoid your application from ending.
  4. Using conditionals.
  5. Implementing a CLI (command line interface).

πŸ“ Instructions

Fill the content of the methods play, check_for_winner, new_game and the commands inside the while needed to make the TicTacToe behave like this picture.

1def play(position): 2def check_for_winner(): 3def new_game():
  1. There are two players X and O.
  2. X always starts playing.
  3. To make a play, the command its play <position> for example: play 1 will play for the current player on the position 1 in the list (the second one)
  4. If X makes a play, it's O's turn (automatically) and vice-versa.
  5. Every time aony player makes a play you have to check for winners.
  6. The game ends when any of the players finally makes a winning combination.
  7. The game can be reset (start again) any time.
  8. The user must stop the game and exit anytime (releasing the terminal).

🌱 How to start this project

Do not clone this repository.

  1. The first step to start coding is cloning the python boilerplate on your local computer or gitpod.

a) If using Gitpod you can clone the boilerplate by clicking here. b) If working locally type the following command from your command line: git clone https://github.com/4GeeksAcademy/flask-rest-hello.

πŸ’‘ Important: Remember to create a new repository, update the remote (git remote set-url origin <your new url>), and upload the code to your new repository using add, commit and push.

  1. Run the app by typing on the terminal:
1$ python3 app.py

Goal

4Geeks Coding Projects tutorials and exercises for people learning to code or improving their coding skills

Difficulty

easy

Repository

Click to open

Video

Not available

Solution video

Not available

Average duration

8 hrs

Technologies

Weekly Coding Challenge

Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!

Start the Challenge

Podcast: Code Sets You Free

A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.

Listen the podcast