mass junior high
New Member
- Joined
- May 13, 2017
- Messages
- 9
In a football match there are three outcomes, a win(win) ,a draw(d ) and lose(l) . For 2 matches, there are 8 possible outcomes and for 3 , 27 possible outcomes. I found this code to list all 27 possible outcomes for 3 matches
Sub stuff()
Const v& = 3
Dim z, y() As String , q()
Dim a&, b&, c&, d&, p&, MaxRow& MaxRow = 65536 z = Array("H", "D", "A") u = UBound (z) + 1
Redim y(1 To u ^ v, 1 To v)
For a = 1 To v
For b = 1 To u ^ v Step u ^ a
For c = b To b + u ^ (a - 1) - 1
For d = 1 To u y(c + u ^ (a - 1) * (d - 1), v - a + 1) = z(d - 1)
Next d, c, b, a
For a = 1 To u ^ v Step MaxRow
Now am trying to list the possible combination for 12 matches provided there are only two outcomes, a win(w) and lose (l).
Please can someone give me a code to list all 64 possible outcomes for 12 matches
Sub stuff()
Const v& = 3
Dim z, y() As String , q()
Dim a&, b&, c&, d&, p&, MaxRow& MaxRow = 65536 z = Array("H", "D", "A") u = UBound (z) + 1
Redim y(1 To u ^ v, 1 To v)
For a = 1 To v
For b = 1 To u ^ v Step u ^ a
For c = b To b + u ^ (a - 1) - 1
For d = 1 To u y(c + u ^ (a - 1) * (d - 1), v - a + 1) = z(d - 1)
Next d, c, b, a
For a = 1 To u ^ v Step MaxRow
Now am trying to list the possible combination for 12 matches provided there are only two outcomes, a win(w) and lose (l).
Please can someone give me a code to list all 64 possible outcomes for 12 matches