Advice on how to create this application

Posted on 2005-05-04
Last Modified: 2010-04-07

I was wondering does anyone have any suggestions on this :

I am begining to create an online registration and scheduling site for some recreational facilities in my area.

I will be using ASP.NET\VB.NET with a MS SQL or MySQL backend.

Most of the app is finished but one of my requirements is to randomize the scheduling of the teams that have registered.

The teams will be stored in the database and I must give the customer the chance to either have the teams play just once a season , but the option must be there for them to play twice a season or three times etc.

In\ how would you approach this requirement?

Many thanks!
Question by:abennett10
    LVL 16

    Expert Comment

    Sounds like you need to add another field to the database and give the
    user an option box or check boxes to choose from:

    You could use a tinyint in the database and assign the following:
    1 = play just one season
    2 = play 2 times
    3 = play 3 times

    then on the web form, use option boxes like:

    Please select how many times a season you wish to play:

    o Just one season
    o Twice a season
    o Three times a season


    Author Comment

    That sounds great,

    But how do I code the part to randomize the teams schedule on how they should be matched up ?
    LVL 16

    Expert Comment

    Sorry, I didn't read your question right.  First you would need to work on the logic for
    the code that would do this.  I would image the code would be using a lot of loops and
    If . . then statements.  This is easier said than done.  But something like this:
           Loop: check for available registered team
                    If available
                      search for another team that is available
                      assign the team
                      mark team as unavailable
           End Loop
    I'll try and add some code later . . or if anyone else can give it a shot
    LVL 10

    Expert Comment

    Hi abennett10,

    Just imagine a 2 dimensional array, teams across and down, each element holds an array of fixture dates,

    if there were 3 teams playing each other once, then each team would play twice,
    as a team cannot play itself, so you need a list of at least 2 available dates, so you would have 3 games to be played,
    now assign each game a date and make sure that date is not reused for either team

    3 Teams Playing Once

    01 v 02
    01 v 03
    02 v 03


    LVL 10

    Accepted Solution


    BTW you would only need to use a crossectional part of the array unless you wanted to use home / away fixtures


    Author Comment


    Thanks I'm starting to visualize how it should be done


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now