Giter Site home page Giter Site logo

irv's Introduction

irv.py

A simple python script for instant-runoff voting

Runs instant-runoff voting(http://en.wikipedia.org/wiki/Instant-runoff_voting) and prints a full ranking of all eligible candidates to standard output.

Usage

python irv.py <input-file> <manual-mode>

If a second argument is NOT given, the script will run in semiautomatic mode, where it runs all eliminations automatically (except eliminations for unbreakable ties).

Input format

The first line of the input should be a tab-separated list of candidate names, and each following line should contain unique positive integers for votes and 0s for abstentions (separated by any form of whitespace). See example1.txt and example2.txt.

irv's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

irv's Issues

Python 3 Compatible

Hi. Can you make this script python 3 compatible? Would be great :)
the 2to3 python translation script doesn't seem to do the trick
Runs fine in python 2

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.