Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Football Scheduler
#1
Can anybody help me make this little program, i know the basics but need help with the math.

i want a random generator to choose who plays who
Reply
#2
Let us see what you have so far, and we can go from there. Wink
Reply
#3
it depends on a few factors

if the number of teams is in the 2 ^ series ie 2,4,8,16,32 it is very easy to do a simple one where each team draws a random team, then the winners are drawn for the next stage etc.

for a football season style where each team plays every other team twice it is also quite easy

things like the world cup where you have group stages might be a little trickier

so it depends on what type of calender, competition you are holding, post some more details and someone will probably help
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#4
Quote:Can anybody help me make this little program, i know the basics but need help with the math.

i want a random generator to choose who plays who
The points made by yetifoot about different football seasons are true, but you did say that you want to choose teams at random. So here's some code to get you started with the random selection of two teams each time. Let's assume that you have a total of 16 teams. I added a little test to make sure that the second random team number is not equal to the first.
Code:
DECLARE FUNCTION RandInt% (lower, Upper)
RANDOMIZE TIMER
dim team1 as integer
dim team2 as integer
const numteams = 16

team1 = Randint% (1,numteams)

do
   team2 = Randint% (1,numteams)
loop while team2=team1

'....... the rest of your code goes here.......


END

' =============================== RandInt% ===================================
'   Returns a random integer greater than or equal to the Lower parameter
'   and less than or equal to the Upper parameter.
' ============================================================================
'
FUNCTION RandInt% (lower, Upper) STATIC
   RandInt% = INT(RND * (Upper - lower + 1)) + lower
END FUNCTION
Note: There are many ways to use the RND function. I found this one, it was documented, and it's always worked for me.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)