The basic idea here it to show you how to set up a weighted random number generator, also known as a biased number generator. The point of this is to allow you to create it so that one result is more likely to appear than another. So it takes the randomness out of a random number generator. Consider this: rolling a die, you have a 1:1 chance of landing on any number. It's completely and utterly random. Same thing with a random number generator. Each number has a 1:1 chance (or 50/50) of being generated. This bit of code, however, allows you to define ranges that are more likely than other to appear. Let's say you want a user to be able to roll 25 on a sixsided die 90% more often than a 1 or a 6. You'd set this up for a 5:90:5 ratio for 1/25/6. Not sure if that makes sense, but if it does, you can see the applications immediately. Usually it's great for determining battle systems where you want the chances of misses and criticals to be lower than the chance of a regular hit.
