Giter Site home page Giter Site logo

game-client's Introduction

game-client

CLI Client for the Game of Three server written in Symfony

This is a small demonstration application for REST API based communication between two clients. It requires a running server - see there: (https://github.com/auxiliaire/game-api). The server itself supports as many games as demanded but one game can be played by two players only.

Features

  • Auto, manual and partially manual modes
  • Full interaction in manual mode
  • Error handling
  • Human vs Computer, Human vs human, Computer vs human and Computer vs computer modes
  • CLI switch to enable full automated mode

Usage

  1. Run php bin/console app:play for manual and partially manual modes or php bin/console app:play -a for automated mode.
  2. Provide input if required.
  3. Wait the second client to join (Run the same way in a different terminal window or tab.)

Docker support

  1. Make sure server is running properly (https://github.com/auxiliaire/game-api).
  2. Run docker-compose build in client project root to create container from preconfigured files.
  3. Start client one using a command like this docker run -it --rm --net host --name gameclient_php_2 -v "$PWD":/app -w /app php:7.0-cli php bin/console app:play. (Alternatively you can add the -a switch to avoid interaction and run auto mode.)
  4. Start client two using a similar command (with different name): docker run -it --rm --net host --name gameclient_php_3 -v "$PWD":/app -w /app php:7.0-cli php bin/console app:play.
  5. The clients will stop automatically after finishing the game.

Notice

Because the game checks the user input on client and server side as well, that means the course of the game ie. the moves are deterministic, that means the initial choice of number determines the end result. The players have no real choice to tweak the moves since there's only one valid choice or step to be taken that results in a number which is dividable with three without modulus.

game-client's People

Contributors

auxiliaire avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

bennyxqg

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.