About us

Learning library

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

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

Machine Learning Engineering (16 weeks)

Full-Stack Software Developer

Search from all Lessons

Social & live learning

The most efficient way to learn: Join a cohort with classmates just like you, live streams, impromptu coding sessions, live tutorials with real experts, and stay motivated.

From zero to getting paid as a developer, learn the skills of today and tomorrow. Boost your professional career and be hired by a technology company.

Start Coding

← 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

beginner

Repository

Click to open

Video

Not available

Live demo

Not available

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

Goal

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

Difficulty

beginner

Repository

Click to open

Video

Not available

Live demo

Not available

Average duration

8 hrs