How to create a game schedule for a sport league? (round robin tournament)

There are 6 teams.

There are 3 courts allowing for 3 games a day so that each team plays only once every day.

There are 25 days of games in this season (75 games total).

How do I generate a schedule of 3 games per day until each team plays every other team once and then loop again until each team has played only twice and so on until there are no games remaining?

True.

1 Like

I hope its true lol

You’re king of this stuff. Can you point me in the right direction? I’m having a mental block.

1 Like

ur app is too confusing

I need to generate a schedule like this? (this is for 8 teams that play a total of 4 games a day)

Day 1:

Team 1 vs Team 2
Team 3 vs Team 4
Team 5 vs Team 6
Team 7 vs Team 8

Day 2:

Team 1 vs Team 3
Team 2 vs Team 4
Team 5 vs Team 7
Team 6 vs Team 8

Day 3:

Team 1 vs Team 4
Team 2 vs Team 3
Team 5 vs Team 8
Team 6 vs Team 7

Day 4:

Team 1 vs Team 5
Team 2 vs Team 6
Team 3 vs Team 7
Team 4 vs Team 8

Day 5:

Team 1 vs Team 6
Team 2 vs Team 5
Team 3 vs Team 8
Team 4 vs Team 7

Day 6:

Team 1 vs Team 7
Team 2 vs Team 8
Team 3 vs Team 5
Team 4 vs Team 6

Day 7:

Team 1 vs Team 8
Team 2 vs Team 7
Team 3 vs Team 6
Team 4 vs Team 5

Here is how to do this in JS

That algorithm is easy enough to implement as a server-side action, but because Bubble is so dumb with objects (and only supports 1-dimensional arrays), you kind of need a second action to handle configuring the matches. (Kind of like a special case of List Popper to make it easy to do a recursive backend workflow to create the individual matches.)

I fiddled with this today because it’s interesting, but I’m not finished just yet.

BTW, you could implement that algorithm described in that StackOverfow article in the front end using List Shifter, but it’s sort of not worth the effort as you really want to create your tournament, round, and match objects in the backend.

I assume your app is on a paid plan and you have access to backend workflows, yeah?

1 Like

Yes, I’m using a paid account and have access to backend workflows.

Thanks!

Hey @ralphlasry :wave:

Thanks for booking a session with me. Glad we were able to set up an example for you and get this working.

Here is the example on the front end that you can always refer to again:

Editor: 805testapp42 | Bubble Editor

Preview: https://805testapp42.bubbleapps.io/version-test/round_robin_final?debug_mode=true

Glad we were able to set up everything on the backend, which will be better and more performant for you.

Hope to have another session in the future with you! :blush: Thanks for the brain workout today. :raised_hands:

Hope that helps! :blush:

@j805 www.NoCodeMinute.com

For All Your No-Code Education Needs:

1 Like

Thank you very much! It’s always a pleasure working with you.

1 Like

Of course. Happy I was able to help out. :blush:

This topic was automatically closed after 70 days. New replies are no longer allowed.