This api plays the game called tic-tac-toe in the US, and called naughts and crosses in some countries. Instructions for how to play the game are here if you’ve never played before: http://www.exploratorium.edu/brain_explorer/tictactoe.html
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Just clone this repository by typing:
https://github.com/JoyLubega/tic-tac-toe.git
- Switch to project directory:
cd tic-tac-toe
- Install project requirements using python pip. But wait, you have to have some stuff before you get to this point. So these are:
- Python3.6 and above
- Python virtual environment Just type:
python -V
in your terminal and if its not greater than or equal to 3.6, you're not in big trouble, there are tons of tutorials to get up up and running with these. Just grub one then come back when done.
Now, you have python3 and a way of running a virtual environment. Lets set up the project environment.(remember we're still in the app directory)
- Create your virtual environment. Usually, without any wrappers:
python -m venv env
- Start your virtual environment:
source env/bin/activate
- Install the project requirements specified in the requirements.txt file. Usually,
pip install -r requirements.txt
This is enough to get you started. You can now run the api using:
python run.py
Easy, just: nosetests --with-coverage
You can use postman or even curl to reach out to the following api endpoints:
URL Endpoint | HTTP Request | Resource Accessed | Access Type |
---|---|---|---|
/game | GET | Get the next move | publc |
- Python Flask - The web framework used for this API
- Andela - Inspiring the idea.