History of The Lottery Program
The first version of The Lottery Program was Lotto.c. There were no options: it simply generated six numbers in the range [1,49]. It was written in November 1994 while starting to learn C using the free Personal C Compiler (PCC v2.1c). It has come a long way since then...
The C program was run in a DOS command window. The first version displayed the results on the screen, but the program was modified in July 1999 to write the output to a file:
Program LOTTO. 10.07.99 @ 16:12.
Numbers in the range [1,49] will be selected at random.
Your 6 numbers are: 36 34 3 17 8 49.
v1 The next stage in the evolution of The Lottery Program was a completely new program written during February 2000 in Microsoft Visual Basic 6 (VB6). The six lottery numbers were calculated using the Rnd Function, the VB inbuilt pseudo-random number generator (PRNG). A test function was added to check the distribution of numbers generated. The results were displayed on screen in a Windows form:
v2 Version 2 of the VB program was developed in June 2001. It had the same user interface as Version 1, but used a new PRNG implementing an algorithm described in: l'Ecuyer P, Efficient and portable combined random number generators, Comm. ACM, 31, 742-749, 774, 1988.
A log file was added to record the sets of numbers generated. The log facility is switched on via a command line switch.
v3 In December 2003 the VB migration wizard was used to convert the program to VB .NET 2003. The new Version 3 had a settings form for the user to modify the range of numbers to be generated and to choose the PRNG - either the l'Ecuyer algorithm or the .NET Framework System.Random class.
v4 In March 2007 The Lottery Program was rewritten from scratch in VB 2005, taking advantage of .NET Framework 2.0. The new Version 4 has several new features and improvements, including:
The default PRNG is now the Mersenne Twister.
The implementation of the 32-bit Mersenne Twister algorithm (MT19937) is based on that in Pseudo-Random Numbers, VB and Doing the (Mersenne) Twist…, Paul Vick, Panopticon Central, 22 September 2006.
- The .NET class System.Security.Cryptography.RNGCryptoServiceProvider is used for the second new PRNG.
- The Copy button sorts the generated numbers and then copies them as a tab-separated list to the Windows clipboard.
- The number of numbers generated can be changed.
- The main form can be switched to portrait orientation, which fits better on screen beside a browser window.
- The About... form links to this page.
- All settings may be changed via command line parameters or the Settings form.
The format of the log file, LotteryLog.txt, now shows algorithm used and range:
30/03/2007 11:56 v4.0.1 Alg:0 [0001,0049] 0032, 0026, 0019, 0048, 0004, 0023
v4.1 In October 2007 a new facility to generate and manage passwords was added, and all forms other than the main one were combined in a tabbed presentation.
v4.2 The password facility proved so useful that a new program was developed specifically for it. It was therefore no longer required in The Lottery Program and was removed in November 2008.
v4.3 In August 2012 a new feature was added to allow each individual number to be copied via Drag & Drop. Unfortunately this appears not to work with the National Lottery web form, although double-clicking on a number and then pasting it in via ctrl-V works fine.