Skip to content

breatheco-de/exercise-tictactoe-cli-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create a TicTacToe CLI using Python

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.

def play(position):
def check_for_winner():
def 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

There are 2 ways to start:

a) Open this link in your browser with Codespaces (recommended) or Gitpod: https://github.com/codespaces/new/?repo=4GeeksAcademy/python-hello

b) You can clone the following repository on your local computer:

$ git clone https://github.com/4GeeksAcademy/python-hello

Steps

  • If working locally, you should have python installed.

  • You should open the terminal on the path of this template and run $ python3 app.py, if everything works correctly, it should show Hello World on the terminal.

  • You can test your code by typing: $ python3 test.py.

💡 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages