Sounds fun
So what I'd normally do in a situation like this would be to create a lot of random commands and while commands
The first part, seeding;
You should make a while command that basically checks to see if all the globals are full. Something like this
Code: Select all
While (a+b+c+d+e+f+g+h<>36) do, begin
You'll be assigning the formation number to each variable, of 1-8 so those added should be 36
You should be sure to set them all to 0 before starting, just in case.
Next you generate 2 numbers, 1 for place and 1 for team/formation, we can assume 1 means the player, it shouldn't matter too much
Code: Select all
place:=Random (1,8)
team:=Random (1,8)
and then you check, if that team has already been assigned. If not, it assigns it to the place, if it has then the loop ends and restarts, trying another combination. We use a switch to assign numbers to variables.
Code: Select all
if(a<>team,and,b<>team,and,c<>team,and,d<>team,and,e<>team,and,f<>team,and,g<>team,and,h<>team) then , begin
switch(Place) do(
case(1) do ( a:=team )
case(2) do ( b:=team )
case(3) do ( c:=team )
case(4) do ( d:=team )
case(5) do ( e:=team )
case(6) do ( f:=team )
case(7) do ( g:=team )
case(8) do ( h:=team )
)
end
and then end the loop
that should seed things.
The other 2 would be much easier
Automatic bracket progression
A way to resolve matchups that don't involve the player
First, you just need to assign a number to another variable that equals that next bracket progression. That's as easy as something like this:
To figure out resolving matches, you can set a difficulty level for the teams.
And then run 2 random commands with the second part being the difficulty. And then compare them.
Code: Select all
If (random (1,difficultyTeamA)>>random (1,difficultyTeamB)
then (runTeamAwins)
else (runTeamBwins)