mass junior high
New Member
- Joined
- May 13, 2017
- Messages
- 9
For a football match there are three outcomes, a win(w) , a draw(d) and lose(l). Selecting two matches gives 8 outcomes
For 3matches there are 27 outcome. The code below list all 27 possible outcomes
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
I wish to list all possible outcomes for 12 matches provided there are only 2 outcomes a win(w) and lose(l) but I can't do it right. Please help thanks
For 3matches there are 27 outcome. The code below list all 27 possible outcomes
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
I wish to list all possible outcomes for 12 matches provided there are only 2 outcomes a win(w) and lose(l) but I can't do it right. Please help thanks