22.18. A randomizer module
We are going to be randomizing our parameters a lot in this book. In most of our programs we’ll want to have a bunch of different objects, and we will want to use randomization to keep the objects from all being the same. In our more advanced programs we may have our objects use randomization so as to give themselves an appearance of interesting behavior.
Even when there’s only one object using a given set of parameters, it’s not always clear which values to use. It may be that there are no ‘best’ values, and it’s more interesting to look at a wide range of possibilities. In other cases, there may be a ‘best’ set of values, but the only way to try and find these values is to feel around the parameter space by trying ...
Get Software Engineering and Computer Games now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.