Skip to content

Instantly share code, notes, and snippets.

@MarshallChris
Last active December 26, 2015 10:39
Show Gist options
  • Save MarshallChris/7137832 to your computer and use it in GitHub Desktop.
Save MarshallChris/7137832 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 24 11:14:24 2013
@author: cmarshall
"""
import time
import numpy as np
print '######################################'
print ' Python Pool Team Generator V0.1.0'
print '######################################'
print ''
solaise_persons = np.array(['Matt', 'Chris', 'Ed', 'Morten', 'Mark', 'Stephen', 'Joao', 'Ali', 'James'])
print '\nShuffling players...\n'
time.sleep(0.5)
print '.'
time.sleep(0.25)
print '.'
time.sleep(0.25)
print '.'
time.sleep(0.25)
np.random.seed()
np.random.shuffle(solaise_persons)
solo = None
if len(solaise_persons) % 2 > 0:
print '\nUnfortunately there are an odd number of players.\n'
solo = solaise_persons[-1]
print '**{0}** plays as a team of one'.format(solo)
solaise_persons = solaise_persons[:-1]
print '\nList of Teams : \n'
ind = 1
for i in np.arange(0,len(solaise_persons), 2):
print 'Team {0} :'.format(ind)
print solaise_persons[i]
print solaise_persons[i+1]
ind +=1
time.sleep(0.5)
if solo != None:
print 'Team {0} :'.format(ind)
print solo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment