Giter Club home page Giter Club logo

udacity.com-nd004-p3-tournament-results's Introduction

FSND P3 - Tournament Results

Relational SQL Database and implementing outline functionality

Installation

This module uses a database backend based on PostgreSQL relying on the psycopg2 module, wich can be obtained using

pip install psycopg2

To install the database, please use the tournament.sql file hosted with this repository. The installation goes like this.

BEWARE: the installation drops any database by the name of tournament. Please make sure You have no such database under this name in place. All data will be lost!

prompt: psql
----------------------------------------------
psql (9.3.16)
Type "help" for help.

vagrant=> \i path/to/tournament.sql

Usage

The module supports multiple tournaments. If you wish for a

# Import the module
from tournament import *

#
# 1) If you wish to set a specific tournament you may set it up
# expility at the start
my_tournament = getContext(False, "My Tournament")["tournament"]

#
# 2) Make sure you clean the tournament data before you start entering fresh data
initTournament(my_tournament)

#
# 3) Insert players. Make it an even number.
registerPlayer("Example player1", my_tournament):
registerPlayer("Example player2", my_tournament):

#
# 4) Get your first pairings
pairings = swissPairings(my_tournament)

#
# 5) Report matches by settin the parameters to the reportMatch function to the
# id of the winner followed by the loser.
reportMatch(id_winner, id_loser, my_tournament)

#
# 6) Read the current standings as a list of tuples. The first one wins!
standings = playerStandings(my_tournament)

Files included

  • tournament.py (md5: 800fee6b0da20dfc323f64b9600d7e3c)
  • tournament.sql (md5: b1517bc363c6c21210630c7f76e3e032)
  • tournament_test.py (md5: 3cbee77924d9fa6623fe9ac68b8fe9f8)
  • tournament_test_multi_tournaments.py (md5: a7c31d99530832fdb570eca8823e3689)
  • README.md-template (md5: 3846df3b2ecc707ef0ff36e523b4587e)

Version

2017-03-28T22:44:03.966000

udacity.com-nd004-p3-tournament-results's People

Contributors

ojonatan avatar

Watchers

James Cloos 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.