How to deal with the lottery program

Source: Internet
Author: User
Lottery Program, find your ideas .. write a winning program for mobile. the winning levels are 1 to 6 respectively corresponding to different prizes & nbsp; the term is three months. The condition is that a user can only win a prize from four to six in three months. why ?. ------ Solution ------------------ The idea is to save multiple mobile phone numbers and read the results cyclically. ------ solution ---------- lucky draw program, ask for ideas ..
Write a winning program for mobile. the winning levels are 1 to 6 respectively corresponding to different prizes.
The term is three months. The condition is that a user can only win a prize from four to six in three months. The user can have multiple chances to win the prize ?.

------ Solution --------------------
The idea is to save multiple mobile phone numbers and read the results cyclically.
------ Solution --------------------
If the same number can be repeated, you should save all participating numbers
During each lucky draw, the winner can be selected through random and equidistance sampling. the direct rand is also acceptable, but the efficiency is not high, and the food price should be huge.

In the out-of-the-box and out-of-the-box mode, you do not need to save all participating numbers, but do a small probability processing for the prize pool.
For example, if there are 10 prizes rand (0, 100000) <10, the winning rate will be one in ten

It is easy for a user to win a prize only once in three months. you only need to keep the winning number for three months, and you can judge it.

------ Solution --------------------
Ajax

Record processing on the server
------ Solution --------------------
Who determines the probability of winning?
------ Solution --------------------
Since you are not sure how many mobile phones are coming back to participate .. Only time periods can be determined .... The time when each award was last won .. Then the time is not enough .....
------ Solution --------------------
The first prize is ITOUCH. now every IPAD/iPhone 4S is embarrassed to say the lucky draw.
------ Solution --------------------
Every day... 300 times a mobile phone? You have another record .....

After writing the post code, we can find the bug and file a lawsuit with mobile ....


Discussion

Reference:

The idea is to save multiple mobile phone numbers and read the results cyclically.

I forgot to mention that there are nine Jiugong cells on the page that can be clicked up to 300 times a day to see if I have won the prize ~

------ Solution --------------------
Discussion

Every day... 300 times a mobile phone? You have another record .....

After writing the post code, we can find the bug and file a lawsuit with mobile ....


Reference:

Reference:

The idea is to save multiple mobile phone numbers and read the results cyclically.

I forgot to mention that there are nine Jiugong cells on the page that can be clicked up to 300 times a day to see if I have won the prize ~

------ Solution --------------------
A normal rand is enough.

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.