Draw calculation---Five-star direct selection Duplex

Source: Internet
Author: User

The lottery results are 5-digit numbers:

Million, thousand, Hundred, Ten, a

Five-star purchase must be at least each bit to choose a number of combinations, if each digit pair on the calculation of winning; then we must first define the duplex format, as follows:

Thousands of Baishi

Lottery results: 1,2,3,4,5

To combine the data:

Betdetail's Betcontent attribute is the betting content,

Betcontent= "1,2,3,4,5";

1  /// <summary>2         ///get all combinations based on the betting content3         /// </summary>4         /// <returns></returns>5         Privatelist<string>getallbets (BasicModel.LotteryBasic.BetDetail Item)6         {7             if(NULL= = Item | |string. IsNullOrEmpty (item. betcontent))8                 return NULL;9             ElseTen             { One                 varBets = Item. Betcontent.split (','); A                 if(Bets. Count ()! =5) -                 { -                     return NULL; the                 } -                 Else -                 { -                     varList =Newlist<string>(); +                     varWAN = bets[0]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); -                     varQian = bets[1]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); +                     varBai = bets[2]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); A                     varShi = bets[3]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); at                     varGE = bets[4]. Select (M =Convert.ToInt32 (m.tostring ())). ToList (); -List = ( fromWinchWan -                              fromQinchQian -                              fromBinchBai -                              fromSinchShi -                              fromGinchGE in                             Select string. Format ("{0}{1}{2}{3}{4}", W, Q, B, S, g)). ToList (); -                     returnlist; to                 } +             } -}
View Code

Perform getallbets to get the result of the combination, and then compare the results, and if you are successful with each position of the lottery results, then the jackpot is long:

1  varList =getallbets (item);2                 varresult = list. Find (M = = m = = Openresult.replace (",",""));3                 if(Result! =NULL)4                 {5Item. IsMatch =true;6                     decimalStepamt =0;7Item. Winmoney = Totalwinmoney (item, Getbaseamt (item,refStepamt), Stepamt,1);8}
View Code

If you do not understand, please direct messages to me or add group: 5,426,204,091 discussions

Draw calculation---Five-star direct selection Duplex

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.