playMaker

Author Topic: Teams Draw  (Read 2399 times)

4arrancho

  • Playmaker Newbie
  • *
  • Posts: 27
Teams Draw
« on: February 19, 2015, 08:47:29 PM »
Hi

I'm trying to create a draw of teams like real life football championships

Just like Premier League. 20 teams. Each team play every other team home and away. Each team play 38 games, so it means we'll have 38 "rounds"

Any suggestion for this crazy idea?

4arrancho

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Teams Draw
« Reply #1 on: February 23, 2015, 12:49:52 PM »
Any tips?

To make it simple, let's make a 4 team group like champions league.

4 teams
every team plays 6 games
3 games at home and 3 games away
Day1: If team A plays Team B, Then Team C has to play Team D
Day2: Team A has to play against Team C or D
Day3: Team A plays against only team that hasn't played before
Day 4,5,6: Repeat the games but if it were played at home, now the team plays away or vice-versa

How to make this kind of calendar?

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Teams Draw
« Reply #2 on: February 24, 2015, 03:34:45 AM »
Hi,

I would consider ArrayMaker

and I would have arrays and hashtable acting as sources, and duplicate them and remove items used ( who that team played against).

 have you worked with ArrayMaker already?

Bye,

 Jean

4arrancho

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Teams Draw
« Reply #3 on: February 24, 2015, 05:06:18 AM »
I know how to use arraymaker but never used hashtable

I created a list with all the teams.
I picked a random team from that list and removed it.

The problem now is to check for the next games so it don't repeat the games

Example: If team1 plays team14 in "day 1" it can't play team14 again in "day 2"

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Teams Draw
« Reply #4 on: February 24, 2015, 06:41:07 AM »
Hi,

 Yeah, so you maintain a hashtable of all the team team A must meet, and once they meet, you remove that entry from this hashtable,

let say Team A just played Team C

remove Team C from Team A list and remove Team A from Team C list

Does that make sense?


Bye,

 Jean

4arrancho

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Teams Draw
« Reply #5 on: February 24, 2015, 03:34:48 PM »
So you suggest i need a list for each team?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Teams Draw
« Reply #6 on: February 25, 2015, 01:35:31 PM »
Hi,

 yep actually two maybe, one for the return matches.

 Bye,

 Jean