473,545 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

auto-generate a fixture list

Hi All

This is a strange request, but I just cannot fathom how to do it.

In theory the requirement is very basic, but in practise its a noodle!!

I have 10 team names like so:

Team A
Team B
Team C
etc ..

I want to create a sort of fixture list that makes sure that each team
'plays' each other just once at home (ie, on the left side) and once away
(ie, on the right side), eg:

Team A v Team B
Team C v Team D
etc..

for what will be 9 weeks (??)

I then want to put this into an Access DB, which is easy enough, but the
former problem is a lot harder.

My initial idea was to enter all the permutations and then use a random
number generator to pick 10 matches for each week's fixture, but this was a
crap idea because I can get the same team's matches listed 4 or 5 times in
the same week.

Any ideas?

Rgds

Laphan

Jul 17 '05 #1
2 8276

"Laphan" <ne**@DoNotEmai lMe.co.uk> wrote in message
news:3f******** @127.0.0.1...
Hi All

This is a strange request, ... [snip]
I have 10 team names like so:

Team A
Team B
Team C
etc ..

I want to create a sort of fixture list that makes sure that each team
'plays' each other just once at home (ie, on the left side) and once away
(ie, on the right side), eg:

Team A v Team B
Team C v Team D
etc..

for what will be 9 weeks (??)

That would be 18 Weeks in total:
Team A plays B - J 1 Time at home then Team A plays B- J 1 Time away.

I then want to put this into an Access DB, which is easy enough, but the
former problem is a lot harder.

My initial idea was to enter all the permutations and then use a random
number generator to pick 10 matches for each week's fixture, but this was a crap idea because I can get the same team's matches listed 4 or 5 times in
the same week.

Any ideas?

Rgds

Laphan


A good way to approach this is to view two columns, Home and Away

First Column A - E, Second Column F - J
Now Each incrementing week rotate the letters one position clockwise, while
leaving A in the same postion each week for the first 9 weeks. This will
give the first 9 Weeks, invert the results for the last 9 Weeks. Ie A Week
1 at home become A Week 10 away.

Mike
Jul 17 '05 #2
Try using a Unique Random Number Generator. This will not repeat the same
number.

Generating Random numbers can be very useful at time, however, a randomly
generated number from a seed number can generate or repeat the same number
if a full list or array on numbers is required. This procedure will generate
a Unique Random Number. This means the generated number will not be
repeated. If the seed for the Random Number were 250, then 250 numbers will
be randomly generated without repeating any of the random generated numbers.

Here is one you might use.

Public Sub GenerateNumber( )
On Error GoTo ErrorHandler
Dim AC As Integer
Dim I As Integer
Dim R As Integer
Dim Response
'Define the flagged array
Dim ACount(250)
'Define the string variable
Dim ANum(250)
'Define the RANDOM number seed
AC = 25
'Set the flags to FALSE
For I = 1 To AC
ACount(I) = False
Next I

'Iteration
For I = 1 To AC
Jump1:
'Exit the generator
If I > AC Then Exit Sub
'Generate RANDOM number from a base defined by AC
R = Int((AC * Rnd) + 1)
'Test the flag for TRUE
If ACount(R) = True Then
GoTo Jump1
End If
'Test the flag for FALSE
If ACount(R) = False Then
'Set the flag to TRUE
ACount(R) = True
'Assign the RANDOM number to an array
ANum(I) = R
'Do what you want with the generated number here.
'You can call another routine if desired
DisplayNumber

End If
Next I
Exit Sub
ErrorHandler:
Response = MsgBox(Err.Desc ription)
End Sub
"Laphan" <ne**@DoNotEmai lMe.co.uk> wrote in message
news:3f******** @127.0.0.1...
Hi All

This is a strange request, but I just cannot fathom how to do it.

In theory the requirement is very basic, but in practise its a noodle!!

I have 10 team names like so:

Team A
Team B
Team C
etc ..

I want to create a sort of fixture list that makes sure that each team
'plays' each other just once at home (ie, on the left side) and once away
(ie, on the right side), eg:

Team A v Team B
Team C v Team D
etc..

for what will be 9 weeks (??)

I then want to put this into an Access DB, which is easy enough, but the
former problem is a lot harder.

My initial idea was to enter all the permutations and then use a random
number generator to pick 10 matches for each week's fixture, but this was a crap idea because I can get the same team's matches listed 4 or 5 times in
the same week.

Any ideas?

Rgds

Laphan


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2592
by: Manlio Perillo | last post by:
Hi. This post follows "does python have useless destructors". I'm not an expert, so I hope what I will write is meaningfull and clear. Actually in Python there is no possibility to write code that follows C++ RAII pattern. Of course Python objects are not statics like in C++, but in C++ the auto_ptr class is used for enforcing this...
1
34298
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like the page to auto-refresh every 4 seconds....if the user un-checks the checkbox, I'd like to turn off the auto refresh. The page is as follows:
1
13948
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the page the way I want. Does anybody know a solution for this? First of all, the code I am using: CSS ------- body {
2
12704
by: Tom | last post by:
I am trying to store information into a table that has an auto increment field. There is currently no data in the table. Using the code below I cannot insert data into the table. I get an error telling me that "Number of query values and destination fields are not the same." If I add a value for the auto increment field to the SQL String...
9
2496
by: Alan Mackenzie | last post by:
To all those who use (X)Emacs's CC Mode to edit C, C++, Java, Objective-C, Pike, AWK or IDL: To help direct the development of CC Mode, it would be useful to find out how people use the auto-newline "minor mode" facility. If you could spare a little time, would you answer these questions, please: o Do you program with auto-newline...
20
2836
by: Vijay Kumar R. Zanvar | last post by:
Hello, Unlike register, auto keyword can not be used to declare formal parameter(s). Is there any specific reason for this? Kind regards, Vijay Kumar R. Zanvar
5
3251
by: maya | last post by:
at work they decided to center divs thus: body {text-align:center} #content {width: 612px; text-align:left; margin: 0 auto 0 auto; } this works fine in IE & FF, EXCEPT in FF it doesn't work if I change 'auto' to 0 for left and right margin values; I have to leave those at 'auto'.. so I would like to know what exactly means 'auto' -- what...
22
3038
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly like that: int main(char argc, char *argv, char *env) { try { auto Exception mainException(1); mainException.setErrNo(42);
2
3054
by: Piotr K | last post by:
Hi, I've encountered a strange problem with Firefox which I don't have any idea how to resolve. To the point: I've <divelement with a style "height: auto" and I want to retrieve this value ("auto") in JavaScript - however instead of getting "auto" value, I get calculated height. In IE and Opera it simply returns "auto". Any ideas how to...
21
6308
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
7409
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3465
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1900
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
720
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.