Jump to content
  • Advertisement
CTGames

Schedule of Tournament

Recommended Posts

Hi

I am trying to create (schedule) a tournament in C#, but I am having some problems which I hope you can help with.

The scenario is that we have two divisions with x number of teams in each division (same amount of teams in each division).

Each team has one fixed fixture each year against the same opponent in the other division.

Our problem is to code the following scenario:

Each team needs to play one team from the other division on a rotating basis each year, and it can't be the fixed opponent.

Do anybody know how to solve that? Either in C# or pseudo code

 

BR

 

Share this post


Link to post
Share on other sites
Advertisement

It is because we are two guys who are trying to make a College Football simulator game in our sparetime

Share this post


Link to post
Share on other sites

I am having a hard time understanding the description of the problem, perhaps because I don't know much about sports. Can you perhaps just post an example of the desired output for a small value of x?

Share this post


Link to post
Share on other sites

Ex. We have two divisions (A + B) with 5 teams in each of them.

Each year all teams in division A will have to meet one team from division B on a rotating basis.

Year 1:

TeamA1 - TeamB1, TeamA2 - TeamB2, TeamA3 - TeamB3, TeamA4 - TeamB4, TeamA5 - TeamB5

Year 2:

TeamA1 - TeamB2, TeamA2 - TeamB3, TeamA3 - TeamB4, TeamA4 - TeamB5, TeamA5 - TeamB1

Etc.

That is easy enough to build. 

The issue is if each team will need to meet two teams from the other division where one of the games are "fixed". With fixed I mean that they will always meet that team.

So if TeamA1 - TeamB1 is fixed then TeamA1 needs to meet TeamB2 year 1, TeamB3 year 2 and TeamB4 year 3

Let us then say that TeamA2 - TeamB2 is also fixed then TeamB2 will meet TeamA1 year1 etc.

I hope this makes sense 

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Make two lists of teams and they meet pairwise, with an offset in the first list that increments with the year.

 

Edit: I think you need to write both lists side-by-side and draw arrows or lines between both lists, that makes it much easier to see patterns then.

For alternatives to fixed games, perhaps you have to leave out one of the teams from one of the lists. I don't quite understand how that works though.

Edited by Alberth

Share this post


Link to post
Share on other sites

This actually gives me a good idea of how to fix it, so thank you very much

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!