A Simpiler way to achieve this, any ideas?

Discussion in 'Programming' started by Omission, Apr 19, 2007.

  1. #1
    I'm currently trying to create a fixture generating system, but trying to make it as flexible as possible. There are a few conditions:

    Each team must play each other twice, 4 Teams (1 v 1 x 2) can play each other at a time (as its a once a week league). So far I've done this, however, as only 4 teams can play each other at a time, if the league is greater than 4 one or more teams have to wait till the following week to play their games. However the current way I'm doing it results in (say in a league 5 big) team 1 playing all their games across several weeks before teams 5 even plays one.

    Basically I need a method of checking which team(s) hasn't played in the first set of 4 and making sure they are selected the following week over the top of the others.

    Currently I'm using a query that selects all the teams who don't have a date for a game assigned > looping the query once picking the top two teams to play > then another query that selects the same but is not either of the first two, to generate the first 2 fixtures.


    I know this mustn't make a great deal of sense, however if someone can offer some insight, or even links to tutorials of fixture generation logic in code .. i'd appreciate it.
     
    Omission, Apr 19, 2007 IP
  2. Omission

    Omission Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well I've decided to select the first fixture at random, the ripple effect that follows that from the other conditional statements seem to make things work out ok. 11 people viewed this thread, apologies for any subsequent headaches from reading the above... think how i feel!
     
    Omission, Apr 19, 2007 IP
  3. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Very good Omission, you are indeed trying and that is where it counts most - keep trying.

    I believe you'll get it sorted out based on your comments, but I have a little spoke to throw in your wheel...what if each team had to rest for a specified period of time? Could your code accommodate that?

    Always push your limits

    daTropics
     
    datropics, Apr 20, 2007 IP
  4. WillBMX

    WillBMX Guest

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Instead of calling it a rest, lets say that each team was required to have a by-week after playing their 3 game. (or which ever)
     
    WillBMX, May 2, 2007 IP