To run the project locally, follow these steps:
- Clone the repository:
git clone <repository-url>
cd games
- Set Up Environment:
Two Options here:
Run it locally:
make venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
make run
Run it on the docker:
make build
make docker_run
Navigate to localhost: http://0.0.0.0:8000/
Tip
You will need to start a new game before you can enter any coordinates. The Coordinates use computer numbering starting with 0. ie (0, 0) (1, 0), (2, 0) etc.
I spent between 3.5 and 4 hours on this project. I was mainly focused on the game and game context as well as the api elements. I used Github Copilot to make an interface. I also saved quite a bit of time by using a python set up template to get my MakeFile, DockerFile etc in place right away.
I assumed the user does know how to play tic tac toe. I also assumed the x, y coordinates would make sense to the user.
Testing is really important to me. So I spent quite a bit of time on writing tests rather than making the interface pretty.
This PR also has github actions which run on push and PR.
I used Pydantic as a nice way to validate inputs. It can also be used to autogen openapi specs which I did not do this time.