league problem in python

Ross ross.jett at gmail.com
Wed Apr 1 13:35:15 EDT 2009


I'm new to programming and have chosen Python as my first language.
I've gone through Allen Downey's Think Python book and I think I'm
ready to dive into a project. The first problem I've chosen to tackle
is a problem I have seen at my tennis club. Each spring/fall, the pro
puts out a sheet of paper for people to sign up for tennis leagues.
Depending on how many people sign up for a league, he'll assign a
certain number of courts each week to that league.

 After this, he makes up a schedule of who plays who on each week and
who has a bye. Unfortunately, he does this by hand and a lot of times,
some people will play certain people more than once and certain other
people never. Other problems that arise: some people have more bye
weeks than others, some people have all their bye weeks clumped
together so that they don't play for weeks on end.

I would like to create a simple program where the pro could enter in
how many people were in the league, the number of courts available,
and the number of weeks the schedule would run and then generate a
schedule where everybody played everybody else once and got the same
number of bye weeks, preferably spaced out evenly.

How should I go about starting this problem...I'm feel like this is a
really simple problem, but I'm having writer's/coder's block. Can you
guys help?



More information about the Python-list mailing list