To enable the lottery program to run directly on any machine without the need to configure the platform, the development tools and compilation and running tools can also be as simple as possible (such as text can be edited, window System built-in browser can compile and run the situation), decided to try to use javascript for small programs such as the lottery using tools such as VB, Delphi to achieve more convenient, because I have not installed such an application on my machine, I can only find another method. To enable the lottery program to run on any machine without the need to configure the platform, the development tools and compilation and running tools can also be easily edited (such as text, window System built-in browser can compile and run the situation), decided to try to use javascript. I am not deeply engaged in javascript research. I usually use javascript for website development to determine the validity of client data (based on security considerations, websites with high security requirements should try to use server-side languages to determine the data validity.) the most common methods and functions are involved. Therefore, the following procedures can only be called simple, and the interface effects and functions are "simple ".
The main key point is to take a random number. the formula (range upper limit-range lower limit + 1) * Math. random () + range lower limit is used to take a random number within the specified range. The source code is as follows:
Lucky draw applet