Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7144 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have 10 teams, I'm trying to write a script that will make a 9 week schedule such that every team plays each other once. Sounds like such and easy thing to write !!! I can easily populate all the fields, but making each match unique has got my brain all twisted. Anyone got any suggestions ?? thanks Ed

Posted

Making each match unique should be a combination of the two teams, maybe ID#'s or the Team Names if they are unique.

At the first team set a Unique Field to ID_Team & "-", then when you get to the team they are playing use Set Field to add the second team, ie. Unique Field = Unique Field & ID_Team.

Posted

Hi Ed,

It seems to me this would be best to use a script to populate related scheduled matchup records based on these rules:

1. A team should not get scheduled to play itself

2. A team should not play another team more than once

We can use nested loops to generate records in a join table for each combination of teams, so long as the creation won't violate those two rules.

Rule 2 brings us to a complication about the direction of the relationships used for the matchup. Using a join table we can add matchup records indicating that one team is scheduled to play another, but this join record will only indicate the scheduled matchup from one team's perspective, not both. We could create two join records for the scheduled matchup, one for each team's perspective, or we could try what I've done in the attached sample and use one join record, but viewed from two perspectives: Home matchups and Away matchups.

Check out the attachment and let me know if it still doesn't make sense.

Matchups.fp7.zip

Posted

This not easy at all - in fact it is quite complex. In addition to the match-ups, there needs to be a schedule. Not only cannot a team play against itself, it also cannot play twice in the same round of games.

I have tried a calculated approach which seems to work, though I haven't really tested it against varying circumstances, e.g. number of teams.

tournament.fp7.zip

Posted

Oh yea, forgot about the weeks thing. Back to the drawing board for my scripted approach. wink.gif

Posted

It's back to the drawing board for me as well - my calculations are wrong!

I can calculate either the correct match-ups, or the correct order of games - but not yet both at the same time...

Posted

Thanks guys, for all the imput, all great ideas. I have written down a solution using C, i just need to translate it into filemaker scripting. If i get it working properly, i will post it. Thanks again.

This topic is 7144 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.