No description
  • Python 97.4%
  • Dockerfile 1.7%
  • Makefile 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Vladimir Vyalov 9a514fd5da Update README.md
2022-10-06 23:04:19 +03:00
.github/workflows Release v0.2.0 2022-09-02 15:36:16 +03:00
onx Add Dockerfile 2022-10-03 13:13:10 +03:00
static Update README.md 2022-08-28 00:23:18 +03:00
tests #15 Rewrite cookie validation with pydantic 2022-09-03 16:35:28 +03:00
.coveragerc Fix tests stability 2022-08-22 20:03:13 +03:00
.flake8 Release v0.2.0 2022-09-02 15:36:16 +03:00
.gitignore Add linting and mypy 2022-08-24 18:50:42 +03:00
.pre-commit-config.yaml Release v0.2.0 2022-09-02 15:36:16 +03:00
.pylintrc Reorganized project structure 2022-08-30 11:21:21 +03:00
CHANGELOG.md Release v0.3.1 2022-09-03 17:25:00 +03:00
Dockerfile Better Dockerfile 2022-10-06 22:57:50 +03:00
LICENSE Create LICENSE 2022-08-28 10:03:35 +03:00
Makefile Update Makefile 2022-09-05 00:22:00 +03:00
poetry.lock Update poetry.lock 2022-09-05 00:17:45 +03:00
Procfile Initial release to PyPI 2022-08-28 14:19:31 +03:00
pyproject.toml Release v0.3.1 2022-09-03 17:25:00 +03:00
README.md Update README.md 2022-10-06 23:04:19 +03:00
run.py Release v0.3.1 2022-09-03 17:25:00 +03:00

Noughts & Crosses (Tic Tac Toe)

RunTests Code style: black

Noughts & Crosses (Tic Tac Toe) terminal based, client-server online game with your partner through websockets.

Requires

Python 3.10

Install

$ pip install onx

or

$ poetry shell
$ poetry add onx

Play Game

For running your game board just type in a terminal:

$ onx

You will see a game board in a waiting for your partner state.

Then ask your partner to run the same cli command with exactly the same cli options. You will be matched to your partner by cli options (size and winning sequence length) on a server side.

If you are running a game with a public server than I'll suggest you to make a shorter delay between running your game board and your partners board. Just for reducing the probability to be matched with somebody else.

TUI screenshot 1

There are command line options for changing game board settings. -g or --grid-size changes grid size. -w or --wining-length changes winning sequence length. -h or --help prints help.

$ onx -g14 -w3

TUI screenshot 1

Run Server and Client Locally

Set up env variables.

$ export LOCALHOST="0.0.0.0"
$ export PORT=8888

Run server.

$ onx -d

Run client.

$ onx

Run Tests

$ git clone git@github.com:vyalow/onx.git
$ cd onx
$ poetry shell
$ poetry install --no-root
$ pytest --cov

Known Limitations

  • onx is currently based on textual TUI framework which is awesome but is at an extremely early development stage. As a result you may be faced with some rendering problem like 711, 710. I'll suggest you to run a game board in a fullscreen mode for now.
  • Public server is currently running on a free Heroku app. It means that a good enough SLA is not expected.

Release

make release version=[patch | minor | major]