This project uses PostgreSQL database to keep track of players and matches in a game tournament.
The game tournament will use the Swiss system for pairing up players in each round: players are not eliminated, and each player should be paired with another player with the same number of wins, or as close as possible.
This project has two parts: defining the database schema (SQL table definitions), and writing the code that will use it.
##Step 1. Install Virtual Box and Vagrant https://www.virtualbox.org/wiki/Downloads
https://www.vagrantup.com/downloads
##Step 2. Clone The Repository fullstack-nanodegree-vm repository
##Step 3. Start vagrant typing following commands on terminal. $ vagrant up
$ vagrant ssh
##Step 3. Enter tournament by. $ cd /vagrant
$ cd tournament
##Step 4. Import database. $ psql
vagrant=> \i tournament.sql
vagrant=> \q
##Step 5. Run the test python code $ python tournament_test.py
##step 6. Output will be
- countPlayers() returns 0 after initial deletePlayers() execution.
- countPlayers() returns 1 after one player is registered.
- countPlayers() returns 2 after two players are registered.
- countPlayers() returns zero after registered players are deleted.
- Player records successfully deleted.
- Newly registered players appear in the standings with no matches.
- After a match, players have updated standings.
- After match deletion, player standings are properly reset.
- Matches are properly deleted.
- After one match, players with one win are properly paired.
Success! All tests pass!