Git Product home page Git Product logo

tournament's Introduction

tournament

Udacity - implementation of a Swiss-system tournament

Description

The goal of the Swiss pairings system is to pair each player with an opponent who has won the same number of matches, or as close as possible.

Requirements

If you want to run the program you have to have Python ~2.7 and PostgreSQL installed on your machine.

Set Up

For an initial set up please follow these 3 steps:

  1. Install Vagrant and VirtualBox.

  2. Clone the fullstack-nanodegree-vm repository.

  3. Inside the vagrant folder from the above-mentioned repository, replace the files inside the tournament folder with the files you can find in this present repository - Github Link.

Usage

Launch the Vagrant VM from inside the vagrant folder with:

vagrant up

vagrant ssh

Execute the following commands to create the necessary tables inside the database:

cd /vagrant/tournament

psql tournament

\i tournament.sql

Execute the following command to run the test and see the output from your console:

python tournament_test.py

Extra credit goals

  • Prevent rematches between players.

  • Don’t assume an even number of players. If there is an odd number of players, assign one player a “bye” (skipped round). A bye counts as a free win. A player should not receive more than one bye in a tournament.

  • Support games where a draw (tied game) is possible. This will require changing the arguments to reportMatch.

Test description

In order to check if extra credits were achieved, the test suite implements the simulation of:

  1. A tournament with an odd number of enrolled players.
  2. A tournament with an even number of enrolled players.

Where, in both cases, tied games are allowed, players can't rematch among each other, players can't receive more than 1 Bye-round each.

tournament's People

Contributors

iliketomatoes avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.