This project is a python application that emulates a swiss-style tournament
1.1.3
- python 2.7
- pip
- psycopg2
- postgresql-9.5
- Multiple tournaments
- Odd number of players
- Tournament Byes
- Zero Rematch
Clone
$ git clone https://github.com/arkiv2/fsd-project2.git SwissTournament
$ cd SwissTournament
Installing Database Blueprint
$ sudo -u postgres psql
postgres=# \i tournament.sql
Add this line at the top
from tournament import *
-
- Syntax
tID = createTournament(Name)
- Usage
tID = createTournament("Olympics")
-
- Syntax
RegisterPlayer(Name, Tournament_ID)
- Usage
RegisterPlayer("Arki Valencia", tID)
-
- Syntax
pairings = swissPairings(Tournament_ID)
- Usage
pairings = swissPairings(tID)
-
- 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
-
- Syntax
standings = playerStandings(Tournament_ID)
- Usage
standings = playerStandings(tID)
-
- Syntax
reportBye(Player_ID, Tournament_ID)
- Usage
reportBye(pID, tID)
-
- Usage
deleteMatches() deletePlayers() deleteTournaments() deleteScoreboard()
chmod +x extra_credit_test.py
./extra_credit_test.py
or
python extra_credit_test.py
- psycopg2 - the most popular PostgreSQL adapter for the Python programming language
Credits