https://github.com/singhpratyush/tournament-udacity
https://github.com/singhpratyush/tournament-udacity
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/singhpratyush/tournament-udacity
- Owner: singhpratyush
- License: mit
- Created: 2016-03-19T08:10:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-30T11:22:10.000Z (over 9 years ago)
- Last Synced: 2025-01-26T16:35:02.332Z (9 months ago)
- Language: Python
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tournament
A database schema to store the game matches between players, implementation according to Swiss system.
### Features
* Swiss pairing of players for matchup. Ranked in order of `number of wins`, then `win to matches ratio` and finally `player ID` (if same values encountered).
* Gives `'bye'` to random player in case of odd players.
* Multiple tournament support.
* No consecutive rematch between players (if there are more than 2 players).
* A player gets highest `'bye'` streak of 1 (if there are more than 2 players).
### Usage
* __Initializing database__
* In a terminal, type `sudo su - postgres` to switch to master user of psql.
* Type `psql` to initiate psql session
* If the user which wants to use database doesn't exists as a role, type
```
create user with password ;
```.
* Add database `tournament` and grant all permissions to the user :
```
create database tournament;
grant all on database tournament to ;
```
* Initiate the tables from the file `tournament.sql` :
```
\i