Giter VIP home page Giter VIP logo

tournament-planner's Introduction

Swiss Tournament Planner

Introduction

This is a project for my Udacity Intro to Programming Nanodegree. It is a Swiss style tournament. A summary of the task is to write a Python module that uses a 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.

Getting started

Tournament code and test code are in Python. The database is in PostgreSQL.

Vagrant VM and Virtual Box

  • This project uses Vagrant Virtual Machine (VM) and Virtual Box
  • Vagrant VM has PostgreSQL installed and configured, as well as the psql command line interface (CLI)

Database

  • Load Terminal and cd to folder where Vagrant is located.
  • Fire up Vagrant vagrant up and when the prompt reappears vagrant ssh to log in
  • To connect first psql then connect to the tournament db \c tournament
  • If the db does not yet exist, create the db CREATE DATABASE tournament and to build the db with tables and views import the .sql file \i tournament.sql
  • Note, code is included in the tournament.sql file to create a new DB called tournament

Python Tournament

  • Load a new Terminal and cd to folder where Vagrant is located.
  • Fire up Vagrant vagrant up and when the prompt reappears vagrant ssh
  • Change directory to the tournament folder cd /vagrant/tournament
  • The terminal prompt should read vagrant@vagrant-ubuntu-trusty-32:/vagrant/tournament$
  • To run the tournament test code type python tournament_test.py

Usage examples

  • Swiss style tournament with a few limitations:
    • Only allows even number of players
    • Games either won or lost, no draws
    • Does not prevent rematches between players
    • Only one tournament can be played, after player and match data must be deleted before a new tournament can be played

tournament-planner's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.