Beispiel #1
0
 /// <summary>
 /// 选X中Y胆拖算法
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 int getDT(int x)
 {
     if (ChoiceLpc.lblTip.Text == "胆码")
     {
         foreach (var item in tList[0])
         {
             tList[1].Remove(item);
             #region 去除拖码冲突号
             var l = tListLabel[1].FirstOrDefault(a => a.Text == item);
             if (l != null)
             {
                 var lpc = l.Parent.Parent.Parent as LotteryChoiceNoControl;
                 if (lpc != null)
                 {
                     lpc.ChoiceLbl(l, null);
                 }
             }
             #endregion
         }
     }
     else if (ChoiceLpc.lblTip.Text == "拖码")
     {
         foreach (var item in tList[1])
         {
             tList[0].Remove(item);
             #region 去除胆码冲突号
             var l = tListLabel[0].FirstOrDefault(a => a.Text == item);
             if (l != null)
             {
                 var lpc = l.Parent.Parent.Parent as LotteryChoiceNoControl;
                 if (lpc != null)
                 {
                     lpc.ChoiceLbl(l, null);
                 }
             }
             #endregion
         }
     }
     if (tList[0].Count * tList[1].Count == 0)
     {
         return(0);
     }
     var n = x - tList[0].Count;
     var m = tList[1].Count;
     return(MyTool.CalculateCombination(n, m));
 }
Beispiel #2
0
        /// <summary>
        /// 计算注数和金额
        /// </summary>
        void calculate()
        {
            tListLabel.Clear();
            tList.Clear();
            List <bool> dwd = new List <bool>();;

            foreach (var item in ChoiceTabPage.Controls)
            {
                var lc = item as LotteryChoiceNoControl;
                dwd.Add(lc.ChoiceList.Count != 0);
                if (lc != null && lc.ChoiceList.Count > 0)
                {
                    tList.Add(lc.ChoiceList);
                    tListLabel.Add(lc.Choicelbl);
                }
                else
                {
                    if (ChoiceTabPage.Text != "定位胆")
                    {
                        lblTotal.Text = lblTotalTxt;
                        txtBetNo.Text = "";
                        return;
                    }
                }
            }
            if (tList.Count == 0)
            {
                lblTotal.Text = lblTotalTxt;
                txtBetNo.Text = "";
                return;
            }
            var bet = 0;

            switch (ChoiceTabPage.Parent.Tag + ChoiceTabPage.Text)
            {
            case "前三直选复式":
            case "前二直选复式":
                bet = BetCalculateTool.CalculateNoRepeatBet(tList);
                break;

            case "前三直选单式":
                break;

            case "前三组选复式":
                bet = MyTool.CalculateCombination(3, tList[0].Count);
                break;

            case "前三组选单式":
                break;

            case "前三组选胆拖":
                bet = getDT(3);;
                break;

            case "前二组选复式":
                bet = MyTool.CalculateCombination(2, tList[0].Count);
                break;

            case "前二组选胆拖":
                bet = getDT(2);;
                break;

            case "不定位":
            case "定位胆":
            case "趣味定_单双":
            case "趣味猜_中位":
                bet = BetCalculateTool.CalculateN(tList);
                break;

            case "胆拖任选二中二":
                bet = getDT(2);
                break;

            case "胆拖任选三中三":
                bet = getDT(3);
                break;

            case "胆拖任选四中四":
                bet = getDT(4);
                break;

            case "胆拖任选五中五":
                bet = getDT(5);
                break;

            case "胆拖任选六中五":
                bet = getDT(6);
                break;

            case "胆拖任选七中五":
                bet = getDT(7);
                break;

            case "胆拖任选八中五":
                bet = getDT(8);
                break;

            case "任选一中一":
                bet = MyTool.CalculateCombination(1, tList[0].Count);
                break;

            case "任选二中二":
                bet = MyTool.CalculateCombination(2, tList[0].Count);
                break;

            case "任选三中三":
                bet = MyTool.CalculateCombination(3, tList[0].Count);
                break;

            case "任选四中四":
                bet = MyTool.CalculateCombination(4, tList[0].Count);
                break;

            case "任选五中五":
                bet = MyTool.CalculateCombination(5, tList[0].Count);
                break;

            case "任选六中五":
                bet = MyTool.CalculateCombination(6, tList[0].Count);
                break;

            case "任选七中五":
                bet = MyTool.CalculateCombination(7, tList[0].Count);
                break;

            case "任选八中五":
                bet = MyTool.CalculateCombination(8, tList[0].Count);
                break;
            }
            lblTotal.Text = BetCalculateTool.GetTotalMoney(bet, (int)nudBS.Value, cboDW.SelectedIndex);
            lblTotal.Tag  = bet + " " + ChoiceTabPage.Parent.Tag + ChoiceTabPage.Text;
            //在文本框显示号码
            var betNo = "";

            if (bet > 0)
            {
                if (ChoiceTabPage.Text != "定位胆")
                {
                    for (int i = 0; i < tList.Count; i++)
                    {
                        foreach (var item in tList[i].OrderBy(n => n))
                        {
                            betNo += item + " ";
                        }
                        if (betNo.Length > 0)
                        {
                            betNo = betNo.Remove(betNo.Length - 1);
                        }
                        betNo += "|";
                    }
                    betNo = betNo.Remove(betNo.Length - 1);
                }
                else
                {
                    var j = 0;
                    for (int i = 0; i < dwd.Count; i++)
                    {
                        if (!dwd[i])
                        {
                            betNo += "|";
                            j++;
                            continue;
                        }
                        foreach (var item in tList[i - j].OrderBy(n => n))
                        {
                            betNo += item + " ";
                        }
                        if (betNo.Length > 0)
                        {
                            betNo = betNo.Remove(betNo.Length - 1);
                        }
                        betNo += "|";
                    }
                    betNo = betNo.Remove(betNo.Length - 1);
                }
            }
            txtBetNo.Text = betNo;
        }