I have seen some examples on forums but they don't seem to cater for what I need.
I am looking at creating a randomly generated fixture list for a football league.
I have 38 gameweeks, and anywhere between 2 and 20 teams in a league (all even numbers). What I need is the logic as to how to create the list.
I want to create a list which will look like the following:
Gameweek 1
A v B
C v D
E v F
Gamweeek 2
A v C
D v E
F v B
Does anyone have any ideas on how I can go about creating this?
This sounds like a math problem! Specifically, permutations (with some recursion). Here are some examples I found with a quick google search:
http://www.codeguru.com/vb/gen/vb_misc/algorithms/article.php/c5607/Permutations-in-Visual-Basic--Generating-All-Possible-Combinations.htm
http://www.vb-helper.com/howto_2005_permute.html
Generate all real combinations in VB .NET
This examples should get you started. The last one seems more practical to what you want to do. If you get stuck along the way, post back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With