Giter VIP home page Giter VIP logo

tic-tac-toe-game's Introduction

Tic Tac Toe Game Documentation

Project Design Assumtions

The whole project consists of two applications:

  • Client
  • Server

That are meant to work together to provide a way to play Tic Tac Toe over the Internet using sockets using the socket library in Python.

Setting the Demo up

Demo can be fired of using Docker Engine.

Need to have:

  • docker installed
  • git installed
  • make (optional but really useful)

Steps if you have make

  • git clone https://github.com/simonloach/PS_2021.git
  • make demo

That builds and runs a total of 11 docker containers(1 server and 10 clients) that work over docker instantiated network defined in docker-compose-demo.yml basing on server/Dockerfile and client/Dockerfile.

Entrypoint scripts are server.py and client.py

Clients will run with option to randomize moves (x,y) and sort of play on its own.

All will be viewed from the scope of docker compose up command and each instance of container is distinguishable by color of the stdout.

Now to interact with containers that play random moves attach to the container that you want to interact with from other terminal. You can do that by typing docker ps and then copy the ID of container that you want to attach to into docker attach <ID>. We suggest observing from the perspective of the server. To restart do make demo-down.

Playing yourself

Additionaly you can do make up to start two containers with automatic moves not enabled on one of them so that you can play yourself against computer.

To restart do make down.

Documentation

Client

Client is an application that functions as combination of user interface and endpoint translator of users inputs and Server messages. All user's inputs are being translated into our Communication Protocol described more throughly in protocol.md.

Server

Server is an application that functions as a deamon. It allows users to connect to it and provides backend for each instance of Client to connect to. Server then handles fiding oponent for the Client initiates an instance of a Game between two Clients that become Player at this stage. Game session is being handled by server until one of the Players wins by aligning three.

Game rules

  • Game is being played on a grid of 3x3 size
  • Each player is either 'O' or 'X'
  • 'O' starts
  • Player put their marks on empty tiles of the grid taking turns
  • The first player to put 3 consecutive marks that line up(horizontaly or verticaly or diagonaly) wins

Technical documentation

Classes are well commented in the code itself. The communication protocol is described in protocol.md.

tic-tac-toe-game's People

Contributors

simonloach avatar zelechowskij avatar

Watchers

 avatar

Forkers

aarukami

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.