Self-paced

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.

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.

Search from all Lessons


LoginGet Started

Register to 4Geeks

← Back to Projects

TicTacToe CLI with Python

Difficulty

  • easy

Average duration

8 hrs

Technologies

Difficulty

  • easy

Average duration

8 hrs

Technologies

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

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • easy

Average duration

8 hrs

Technologies

Difficulty

  • easy

Average duration

8 hrs

Technologies

Difficulty

  • easy

Average duration

8 hrs

Technologies

Difficulty

  • easy

Average duration

8 hrs

Technologies

Signup and get access to similar projects

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • easy

Average duration

8 hrs

Technologies

Difficulty

  • easy

Average duration

8 hrs

Technologies