Giter Club home page Giter Club logo

ds-project's Introduction

DS project

Setting up the development environment

Run the script to setup the development environment.

chmod +x setup.sh
./setup.sh

Dependency control

Note: ./setup.sh syncs these dependencies automatically when run,

Sync dependencies

pip-sync

Add or update dependencies

pip-compile

Use the game logic

When you need to use the game logic first thing import the game object

from game_logic.game import Game

after that instantiate an object of the class Game. This wil create a database in ram and the manage the game logic. You can access it using public 3 methods and 1 public attribute:

ground

is a public attribute that contains a reference to the playing ground

players()

Return a list of the four different players

show_place_cards(place)

Return a list of the cards contained in one place. By place are ment both the hands of the player and the ground

play_card(card, player)

Require a card and a player. If the card is in the hand of the player the method will play it. If the card is not in the player hand it will raise an exception: "card not in player hand"

points_counter()

Return the points of Team one and Team Two as two int values. Before counting the points it check that each player played all the cards if is not the case throws an exception

Play the game

Start the system first, requires Docker.

chmod +x run.sh
./run.sh

After that connect 4 clients by running the following 4 times in separate terminals:

chmod +x play.sh
./play.sh

You need to give a second or two for client to connect (this is still a working issue) Then you can play card with client and see what happens.

ds-project's People

Contributors

nardi98 avatar nannakaroliina avatar roorro avatar

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.