Skip to content

Udacity FSND(Full Stack Developer Nanodegree) Course Requirement #3

Notifications You must be signed in to change notification settings

arkiv2/tournament-results

Repository files navigation

FSD-Project3

Udacity FSD(Full Stack Developer Nanodegree) Course Requirement

This project is a python application that emulates a swiss-style tournament

Version

1.1.3

Requirements

  • python 2.7
  • pip
  • psycopg2
  • postgresql-9.5

Features

Supports
  • Multiple tournaments
  • Odd number of players
  • Tournament Byes
  • Zero Rematch

Installation

Clone

$ git clone https://github.com/arkiv2/fsd-project2.git SwissTournament
$ cd SwissTournament

Installing Database Blueprint

$ sudo -u postgres psql
postgres=# \i tournament.sql
Create a new file and import from tournament.py

Add this line at the top

from tournament import *

Usage

  • Creating a tournament

    • Syntax
    tID = createTournament(Name)
    • Usage
    tID = createTournament("Olympics")
  • Creating a player

    • Syntax
    RegisterPlayer(Name, Tournament_ID)
    • Usage
    RegisterPlayer("Arki Valencia", tID)
  • Applying swiss-style tournament

    • Syntax
    pairings = swissPairings(Tournament_ID)
    • Usage
    pairings = swissPairings(tID)
  • Reporting match results

    • Syntax
    reportMatch(Tournament_ID, Winner, Loser, isDraw = False)
    • Usage
    reportMatch(tID, 1, 2)          // Player_ID 1 is the winner
    reportMatch(tID, 1, 2, True)    // Match is a draw
  • Get Player Standings

    • Syntax
    standings = playerStandings(Tournament_ID)
    • Usage
    standings = playerStandings(tID)
  • Reporting a bye

    • Syntax
    reportBye(Player_ID, Tournament_ID)
    • Usage
    reportBye(pID, tID)
  • Deleting Records

    • Usage
    deleteMatches()
    deletePlayers()
    deleteTournaments()
    deleteScoreboard()

Using the test cases

chmod +x extra_credit_test.py
./extra_credit_test.py

or

python extra_credit_test.py

Plugins

  • psycopg2 - the most popular PostgreSQL adapter for the Python programming language

Credits

About

Udacity FSND(Full Stack Developer Nanodegree) Course Requirement #3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages