Giter Site home page Giter Site logo

vyalovvldmr / onx Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 0.0 2.33 MB

Noughts & Crosses terminal based, client-server online game with your partner through websockets.

License: GNU General Public License v3.0

Python 97.43% Makefile 0.81% Procfile 0.06% Dockerfile 1.70%
aiohttp asyncio cli client-server console game multiplayer network noughts-and-crosses noughts-crosses

onx's Introduction

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 [email protected]: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]

onx's People

Contributors

vyalovvldmr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

onx's Issues

Change statuses numeration

Change game statuses to


class GameStatus:
    # game is waiting for a player
    awaiting: int = 100
    # game is in progress
    in_progress: int = 200
    # game is finished
    finished: int = 300

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.