-4

我在 VBA 中开发了一个宏,它结合了代表 27 种不同组合的三个三元组足球池。27 表示最大可能的投注组合。我想修改列表以开发具有双重、固定、三重预测的系统;

例如,现在该程序仅适用于:

1st  game   1 x 2 
2nd game   1 x 2 
3rd game   1 x 2 

等于(3 * 3 * 3 = 27 possible combinations)

但如果预测如下:

1st game   1 x
2nd game   1
3rd game   1 x 2

等于(2 * 1 * 3 = 6 possible combinations)

现在:第一场比赛 1 x 2 ,第二场比赛 1 x 2 ,第三场比赛 1 x 2 ,等于(3 * 3 * 3 = 27 个组合)但如果预测应该如下:第一场比赛 1 x,第二场比赛 1 ,第三场比赛 x 2 ,等于 (2 * 1 * 3 = 6 个组合) 应该只打印有效列。

提前谢谢谁能帮我解决问题。

 Sub Combination_Prediction()

   Dim A As Integer
   Dim B As Integer
   Dim C As Integer
   Dim Col1Sviluppo As Integer
   Dim Row1Sviluppo As Integer

 Col1Sviluppo = 10
 Row1Sviluppo = 14

 For C = 3 To 5
     For B = 3 To 5
          For A = 3 To 5
               Contatore = Contatore + 1
               Col1Sviluppo = Col1Sviluppo + 1
               Cells(Row1Sviluppo + 1, Col1Sviluppo) = Cells(2, A)
               Cells(Row1Sviluppo + 2, Col1Sviluppo) = Cells(3, B)
               Cells(Row1Sviluppo + 3, Col1Sviluppo) = Cells(4, C)
               Cells(10, 10) = Contatore & " colonne elaborate"
         Next A
     Next B
    Next C
  End Sub 
4

1 回答 1

0

免责声明:您的逻辑基于不可预测的假设。如果您下注真钱,请不要转发。这一切都比你想象的要复杂。只有一种可靠的投注和赚钱方式(需要大量资金才能开始,并且需要对博彩公司的政策有正确和良好的理解),它被称为“肯定投注” 。但是,请不要参与其中。

现在,回到你原来的问题。

您可以让函数根据输入 »组合乘数返回组合的数量

让我们假设

combinations multipliers
1 - 1
2 - 1X
3 - 1X2

1代表主客场胜利,1组合

2代表主场胜利或平局,客场胜利或平局,2组合

3是默认值:赢,平局,赢

编码:

Sub Combination_Prediction()

    ' combinations multipliers
    ' 1 - 1
    ' 2 - 1X
    ' 3 - 1X2

    Range("A1") = Combination(3, 3, 3) ' 1x2, 1x2, 1x2
    Range("B2") = Combination(2, 1, 3) ' 1x, 1, 1x2

End Sub

Function Combination(c1 As Long, c2 As Long, c3 As Long) As Long

    Dim i As Long, j As Long, k As Long, combinationMultiplier As Long
    combinationMultiplier = 0

    For i = 1 To c1
        For j = 1 To c2
            For k = 1 To c3
                combinationMultiplier = combinationMultiplier + 1
            Next k
        Next j
    Next i

    Combination = combinationMultiplier
End Function

如果您运行此代码,您将在单元格A1编号27中看到可能投注的正确和简化)计算。

Combination()函数采用3个参数,它们是3组合。

在第一个示例中,第一个输入来自您3, 3, 3示例

第一场比赛 = 1x2

第二场比赛 = 1x2

第三场比赛 = 1x2

现在看看上面的组合乘数

第一场比赛 = 1x2 = 3

第二场比赛 = 1x2 = 3

第三场比赛 = 1x2 = 3

因此,您的 3 个参数是:3, 3, 3

您提供的第二个样本

第一场比赛 = 1x = 2

第二场比赛 = 1 = 1

第三场比赛 = 1x2 = 3

因此Combination(2, 1, 3)将返回6组合)到 CellA2

将任何组合粘贴1, 2, 3到组合功能中以获得结果。您可以将它们打印到单元格或使用msgboxdebug.print进行测试。

我希望这会有所帮助

于 2013-09-03T08:32:34.443 回答