Skip to content

VenelinMartinov/tic_tac_toe

Repository files navigation

Tic-Tac-Toe Server

This is a very simple implementation of a tic-tac-toe server and client. It allows two players to play tic-tac-toe via http requests.

Running the code

The project uses poetry for dependencies.
Instructions for installing here.
poetry install to install the required packages.

You'll also need tesseract for OCR.

poetry run uvicorn server.server_main:app to run the server.

Playing

The full api documentation is available at /docs

There's a cli client under t3_client/client_main.py.
Run poetry run python t3_client/client_main.py --help for instructions on how to use it.

Start a game with
poetry run python ./t3_client/client_main.py start --name "player1"

Join a game as the second player with
poetry run python ./t3_client/client_main.py --cache-location t4_cache join --name "player2" --game-id <GAME_ID>

Get the game state with
poetry run python ./t3_client/client_main.py state

Play a turn with
poetry run python ./t3_client/client_main.py turn 0 0

Play a turn with an image with
poetry run python ./t3_client/client_main.py image-turn tic-tac-toe-example.png

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages