https://www.udacity.com/course/viewer#!/c-ud197-nd/
Udacity Full Stack developer project 2
Develop a database schema to store details of a games matches between players.
Then write a Python module to rank the players and pair them up in matches in a tournament.
tournament.py
Contains the implementation for the Swiss tournament
tournament.sql
Contains the SQL queries to create the database, tables and views
tournament_test.py
Contains the test cases for tournament.py
The latest vagrant build for the Udacity tournament project. (In project notes)
- Start Vagrant
- Open Terminal or cmd and browse to the vagrant folder
- Type
vagrant up
- SSH in to the vagrant VM
- In the same terminal type
vagrant ssh
- Change to the correct folder
- Type
cd /vagrant/tournament
- Open PSQL and run the tournament.sql
- type
psql
- copy the contents of tournament.sql and paste in to the terminal window
- type
\q
to quit out of PSQL - Run the tests
- In the terminal type
python tournament_test.py
Success! All tests pass!
vagrant@vagrant-ubuntu-trusty-32:/vagrant/tournament$ python tournament_test.py
- Old matches can be deleted.
- Player records can be deleted.
- After deleting, countPlayers() returns zero.
- After registering a player, countPlayers() returns 1.
- Players can be registered and deleted.
- Newly registered players appear in the standings with no matches.
- After a match, players have updated standings.
- After one match, players with one win are paired.
Success! All tests pass!
If the top two players have the same won match count, and have won more than 0 games, then the standings is ordered by total number of wins by games played in descending order.