stevoPerisic / fullstack-nanodegree-vm

This is a Python module that uses the PostgreSQL database to keep track of players and matches in a game tournament.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project 2 - Swiss Tournament Planner

This is a Python module that uses the 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.

Requirements

  • Vagrant VM
  • Python 2.7.9 or later

Installation and running

  • Clone this repository and cd into it.
  • Run vagrant up to start the VM
  • Log into the VM using vagrant ssh
  • Change your directory to /vagrant/tournament/
  • Start a psql prompt with psql
  • You should be connected to the vagrant database
  • Install the tournament database with \i tournament.sql
    This should be your output:
``` vagrant=> \i tournament.sql CREATE DATABASE You are now connected to database "tournament" as user "vagrant". CREATE TABLE CREATE TABLE CREATE VIEW CREATE VIEW CREATE VIEW tournament=> ```
  • Quit the psql prompt with \q
  • Run python tournament_test.py
  • All the tests should be passing
``` vagrant@vagrant-ubuntu-trusty-32:/vagrant/tournament$ python tournament_test.py 1. Old matches can be deleted. 2. Player records can be deleted. 3. After deleting, countPlayers() returns zero. 4. After registering a player, countPlayers() returns 1. 5. Players can be registered and deleted. 6. Newly registered players appear in the standings with no matches. 7. After a match, players have updated standings. 8. After one match, players with one win are paired. Success! All tests pass! ```

About

This is a Python module that uses the PostgreSQL database to keep track of players and matches in a game tournament.


Languages

Language:Python 92.6%Language:Ruby 4.3%Language:Shell 3.1%