Function TirageÉquitOK(ByVal NbJrs As Long, ByVal Manches As Long) As Boolean
Dim X As Long, M As Long, TArbitres(1 To 3) As New ListeAléat, A As Long, Arbitres As ListeAléat, L As Long, J As Long
UFmVisu.DescConfig NbJrs & " joueurs " & Manches & " manches."
If NbJrs Mod 3 <> 0 Then UFmVisu.Echec "Effectif non multiple de 3": Exit Function
MMax = Manches: LMax = NbJrs \ 3
X = XTria(NbJrs, NbJrs - 1)
ReDim Tirage(1 To MMax, 1 To LMax, 1 To 3), _
JoueursManche(1 To MMax), DéjàRenc(0 To X)
Randomize
For M = 1 To MMax: Set JoueursManche(M) = New ListeAléat
JoueursManche(M).Init NbJrs: Next M
For A = 1 To 3: TArbitres(A).Init NbJrs: Next A
For M = 1 To MMax
Set Arbitres = TArbitres((M - 1) Mod 3 + 1)
For L = 1 To LMax
J = Arbitres.Aléat: If J = 0 Then UFmVisu.Echec "Arbitres ?!": Exit Function
Arbitres.Supprimer J: JoueursManche(M).Supprimer J
Tirage(M, L, 3) = J
Next L, M
NivMax = MMax * LMax - 1
If RencTrouvée(0) Then TirageÉquitOK = True: UFmVisu.Conclure Else UFmVisu.Echec
End Function