/// <summary> /// 双色球复式算奖 /// </summary> /// <param name="code">所选号码</param> /// <param name="drawedNumber">开奖号码</param> /// <returns>奖级</returns> protected int CompoundSsq(string code, string drawedNumber) { int level = 0; string[] ArrDrawedNumber = drawedNumber.Split('*'); List <string> ReddrawedNumber = ArrDrawedNumber[0].Split(',').ToList(); List <string> BluedreawedNumber = ArrDrawedNumber[1].Split(',').ToList(); string[] ComNumber = code.Split('*'); List <string> RedNumbers = ComNumber[0].Split(',').ToList(); List <string> BlueNumbers = ComNumber[1].Split(',').ToList(); List <string> RedNumber = BbMath.GetPortfolio(RedNumbers, 6); List <string> BlueNumber = BbMath.GetPortfolio(BlueNumbers, 1); /* 拆分复式为单式,红蓝球用“|”分割 */ var array = BbMath.GetArrayList(RedNumber, BlueNumber, "|"); for (int j = 0; j < array.Count(); j++) { string[] newcode = array[j].Split('|'); List <string> RedchosedNumber = newcode[0].Split(',').ToList(); List <string> BluechosedNumber = newcode[1].Split(',').ToList(); level = this.SsqSingle(RedchosedNumber, BluechosedNumber, ReddrawedNumber, BluedreawedNumber); if (level > 0) { break; } } return(level); }
/// <summary> /// 大乐透复式算奖 /// </summary> /// <param name="code">所选号码</param> /// <param name="drawedNumber">开奖号码</param> /// <param name="investType">是否追加</param> /// <param name="level">奖级</param> /// <returns>中奖金额</returns> protected int CompoundDlt(string code, string drawedNumber) { int level = 0; string[] ArrDrawedNumber = drawedNumber.Split('*'); List <string> FrondrawedNumber = ArrDrawedNumber[0].Split(',').ToList(); List <string> BackdreawedNumber = ArrDrawedNumber[1].Split(',').ToList(); string[] ComNumber = code.Split('*'); List <string> FrontNumbers = ComNumber[0].Split(',').ToList(); List <string> BackNumbers = ComNumber[1].Split(',').ToList(); List <string> FrontNumber = BbMath.GetPortfolio(FrontNumbers, 5); List <string> BackNumber = BbMath.GetPortfolio(BackNumbers, 2); /* 拆分复式为单式,前后区用“|”分割 */ var array = BbMath.GetArrayList(FrontNumber, BackNumber, "|"); for (int j = 0; j < array.Count(); j++) { string[] newcode = array[j].Split('|'); List <string> FronchosedNumber = newcode[0].Split(',').ToList(); List <string> BackchosedNumber = newcode[1].Split(',').ToList(); level = this.DltSingle(FronchosedNumber, BackchosedNumber, FrondrawedNumber, BackdreawedNumber); if (level > 0) { break; } } return(level); }
/// <summary> /// 双色球胆拖算奖 /// </summary> /// <param name="code">所选号码</param> /// <param name="drawedNumber">开奖号码</param> /// <returns></returns> protected int BraveryTowSsq(string code, string drawedNumber) { int level = 0; string[] ArrDrawedNumber = drawedNumber.Split('*'); List <string> ReddrawedNumber = ArrDrawedNumber[0].Split(',').ToList(); List <string> BluedreawedNumber = ArrDrawedNumber[1].Split(',').ToList(); List <string> array = new List <string>(); string[] TowNumber = code.Split('*'); string[] RedBraveryTow = TowNumber[0].Split('@'); string[] RedBraveryNumbers = RedBraveryTow[0].Split(','); //前区胆码 List <string> RedTowBumbers = RedBraveryTow[1].Split(',').ToList(); //前区拖码 List <string> RedBraveryList = new List <string> { RedBraveryTow[0] }; //将前区胆码转为泛型 List <string> RedTowNumber = BbMath.GetPortfolio(RedTowBumbers, 6 - RedBraveryNumbers.Count()); //将拖码组合 List <string> RedNumberCombination = BbMath.GetArrayList(RedBraveryList, RedTowNumber, ","); //得到胆码拖码所有组合 string[] BlueBraveryTow = TowNumber[1].Split(','); array = BbMath.GetArrayList(RedNumberCombination, BlueBraveryTow.ToList(), "|"); for (Int32 j = 0; j < array.Count(); j++) { string[] newcode = array[j].Split('|'); List <string> FronchosedNumber = newcode[0].Split(',').ToList(); List <string> BackchosedNumber = newcode[1].Split(',').ToList(); level = this.SsqSingle(FronchosedNumber, BackchosedNumber, ReddrawedNumber, BluedreawedNumber); if (level > 0) { break; } } return(level); }
/// <summary> /// 大乐透胆拖算奖 /// </summary> /// <param name="code">所选号码</param> /// <param name="drawedNumber">开奖号码</param> /// <returns></returns> protected int BraveryTowDlt(string code, string drawedNumber) { int level = 0; string[] ArrDrawedNumber = drawedNumber.Split('*'); List <string> FrondrawedNumber = ArrDrawedNumber[0].Split(',').ToList(); List <string> BackdreawedNumber = ArrDrawedNumber[1].Split(',').ToList(); List <string> array = new List <string>(); string[] TowNumber = code.Split('*'); string[] FrontBraveryTow = TowNumber[0].Split('@'); List <string> FrontNumberCombination = new List <string>(); if (FrontBraveryTow.Length == 1) { List <string> FrontBraveryList = FrontBraveryTow[0].Split(',').ToList(); //将前区胆码转为list FrontNumberCombination = BbMath.GetPortfolio(FrontBraveryList, 5); //得到胆码拖码所有组合 } else if (FrontBraveryTow.Length == 2) { string[] FrontBraveryNumbers = FrontBraveryTow[0].Split(','); //前区胆码 List <string> FrontTowBumbers = FrontBraveryTow[1].Split(',').ToList(); //前区拖码 List <string> FrontBraveryList = new List <string> { FrontBraveryTow[0] }; //将前区胆码转为泛型 List <string> FrontTowNumber = BbMath.GetPortfolio(FrontTowBumbers, 5 - FrontBraveryNumbers.Count()); //将拖码组合 FrontNumberCombination = BbMath.GetArrayList(FrontBraveryList, FrontTowNumber, ","); //得到胆码拖码所有组合 } string[] BackBraveryTow = TowNumber[1].Split('@'); if (BackBraveryTow.Length == 1) { //后区无胆码 List <string> BackBraveryTows = BackBraveryTow[0].Split(',').ToList(); List <string> BackTowNumbers = BbMath.GetPortfolio(BackBraveryTows, 2); array = BbMath.GetArrayList(FrontNumberCombination, BackTowNumbers, "|"); } else { //后区有胆码 List <string> BackBraveryNumber = BackBraveryTow[0].Split(',').ToList(); List <string> BackBraveryList = new List <string> { BackBraveryTow[0] }; List <string> BackTowNumber = BbMath.GetPortfolio(BackBraveryTow[1].Split(',').ToList(), 1); List <string> BackNumberCombination = BbMath.GetArrayList(BackBraveryList, BackTowNumber, ","); array = BbMath.GetArrayList(FrontNumberCombination, BackNumberCombination, "|"); } for (Int32 j = 0; j < array.Count(); j++) { string[] newcode = array[j].Split('|'); List <string> FronchosedNumber = newcode[0].Split(',').ToList(); List <string> BackchosedNumber = newcode[1].Split(',').ToList(); level = this.DltSingle(FronchosedNumber, BackchosedNumber, FrondrawedNumber, BackdreawedNumber); if (level > 0) { break; } } return(level); }
public int FixedUnset(string code, string drawedNumber, int size) { string[] codes = code.Split('@'); List <string> draweds = drawedNumber.Split(',').ToList(); List <string> fixedCodes = codes[0].Split(',').ToList(); //胆码 List <string> unsetCodes = codes[1].Split(',').ToList(); //拖码 int fixedCount = fixedCodes.Intersect(draweds).Count(); //胆码中 个数 int unsetCount = unsetCodes.Intersect(draweds).Count(); //拖码中 个数 int BonusCount = 0; if (size <= 5) { bool isFixedWinner = this.IsFixedWinner(fixedCodes, draweds); if (isFixedWinner == false) { return(0); } int count = BbMath.Combin(unsetCount, size - fixedCount); if (count > 0) { BonusCount = 1; } } else if (size == 6) { if (fixedCount == draweds.Count) { BonusCount = BbMath.Combin(unsetCount, size - fixedCount); } else if (fixedCount == 0) { if (fixedCodes.Count == 1 && unsetCount == 5) { BonusCount = 1; } } else if ((size - fixedCodes.Count) >= (5 - fixedCount)) { if (fixedCount + unsetCount == 5) { BonusCount = 1; } } } else { if (fixedCount == draweds.Count) { BonusCount = 1; } else if (fixedCount == 0) { if (fixedCodes.Count < size - 4) { if (unsetCount == 5) { BonusCount = 1; } } } else if ((size - fixedCodes.Count) >= (5 - fixedCount)) { if (fixedCount + unsetCount == 5) { BonusCount = 1; } } } if (BonusCount > 0) { return(1); } return(0); }