From bb763459b2111cff9a973931a5a602d9b7dbc42c Mon Sep 17 00:00:00 2001 From: Valdos Sine Date: Mon, 2 Sep 2013 22:20:09 +0400 Subject: [PATCH] great12: RESULTS fixed --- autumm2013/roundrobin.py | 33 +++++++++++++++++++++++++++++++++ great12/RESULTS | 12 +++++++----- 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100755 autumm2013/roundrobin.py diff --git a/autumm2013/roundrobin.py b/autumm2013/roundrobin.py new file mode 100755 index 0000000..f56b5f8 --- /dev/null +++ b/autumm2013/roundrobin.py @@ -0,0 +1,33 @@ +#!/usr/bin/python2 +# -*- coding: utf-8 -*- +def roundRobin(units, sets=None): + """ Generates a schedule of "fair" pairings from a list of units """ + if len(units) % 2: + units.append(None) + count = len(units) + sets = sets or (count - 1) + half = count / 2 + schedule = [] + for turn in range(sets): + pairings = [] + for i in range(half): + pairings.append((units[i], units[count-i-1])) + units.insert(1, units.pop()) + schedule.append(pairings) + return schedule + +# LOR sheduler + +players = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] +tour_count = 0 + +# Generate LORCODE for pairings. +# Also generate "reversal" for autumm season. +for pairings in roundRobin(players): + tours = (len(players) - 1) * 2 + tour_count = tour_count + 1 + print "[b]Тур №" + str(tour_count) + "[/b]" + print "[list]" + for pair in pairings: + print "[*]" + pair[0] + " играет против " + pair[1] + print "[/list]" diff --git a/great12/RESULTS b/great12/RESULTS index f4f7301..1601062 100644 --- a/great12/RESULTS +++ b/great12/RESULTS @@ -38,9 +38,11 @@ http://www.linux.org.ru/forum/talks/9088834 * 2: HunOL - 18 очков * 3: Zodd - 13.5 очков * 4: William - 12 очков -* 5: Komintern, aptyp - 9.5 очков -* 6: raven_cler, shell-script - 9 -* 7: Debasher - 8.5 -* 8: trex6 - 7 очков -* 9: J - 5.5 очков +* 5: aptyp - 9.5 очков (1.5 очка против Komintern) +* 6: Komintern - 9.5 очков (0.5 очка против aptyp) +* 7: raven_cler - 9 очков (коэффициент Бергера - 35) +* 8: shell-script - 9 очков (коэффициент Бергера - 34) +* 9: Debasher - 8.5 очков +* 10: trex6 - 7 очков +* 11: J - 5.5 очков * pylin, snoopcat - выбыли из турнира