8.4 Beta - Enhanced Shuffle & Random Number Generator
Posted: Fri 12 Oct, 2007 12:10 pm
This enhancement is the result of a discussion following on from Edward Faith's post "Shuffle Algorithm?" of 24 September. The upshot is that the methodology used to shuffle the cards is now based on .NET's cryptographically superior RandomNumberGenerator class, rather than the rather more predictable Random class of the System namespace. I will post more details on that thread.
The second part of this is that, in order to allow the user to start from scratch with a new deck based entirely on random number capture, the program can be made to store random numbers arising from the user's mouse movements. This needs to be activated before the program will do it. You can do this on the Utilities tab of the General section of the options form.
Once random mouse capture has been activated you will see how the program stores numbers in a battery of five arrays (or an array of five batteries if you prefer). You have to move the mouse around to charge these up, but they are always being stored when this function is activated, and they are not lost between program sessions, so in the normal run of things there should always be a sufficient charge for a new deck. If not the program shows the progress of the random number capture as a way to indicate the delay.
If you activate this function you will notice that the new deck builds up very quickly to begin with, but then slows towards the end. This is because any numbers that have already been used in one deck can't be added again (because you can't have duplicate cards in the deck). To make the capture more efficient a number that is not needed in one array will be passed to any of the other arrays that are incomplete, before being definitively discarded.
Once activated you can start with a new deck by pressing "Control+Alt+R", so there is no need to go into the Options form each time.
The second part of this is that, in order to allow the user to start from scratch with a new deck based entirely on random number capture, the program can be made to store random numbers arising from the user's mouse movements. This needs to be activated before the program will do it. You can do this on the Utilities tab of the General section of the options form.
Once random mouse capture has been activated you will see how the program stores numbers in a battery of five arrays (or an array of five batteries if you prefer). You have to move the mouse around to charge these up, but they are always being stored when this function is activated, and they are not lost between program sessions, so in the normal run of things there should always be a sufficient charge for a new deck. If not the program shows the progress of the random number capture as a way to indicate the delay.
If you activate this function you will notice that the new deck builds up very quickly to begin with, but then slows towards the end. This is because any numbers that have already been used in one deck can't be added again (because you can't have duplicate cards in the deck). To make the capture more efficient a number that is not needed in one array will be passed to any of the other arrays that are incomplete, before being definitively discarded.
Once activated you can start with a new deck by pressing "Control+Alt+R", so there is no need to go into the Options form each time.