Tired of writing the same “randomize array” routines over and over?, just snap this little macro and register them as you see fit. A guard should be put to avoid double registrations (although the compiler will complain about this anyway — I suggest registering right after you include this, since you already know what you’re going to need… )
Code:
http://gushh.net/dev/?file=pb/randomizearray.pb
Examples:
http://gushh.net/dev/?file=pb/randomizearray_test.pb
Simple, right?
A need for both a debug / format (to string) and random fills for string arrays is present, but I’m not in the need of them at the moment. Do request if you need them though.
Cheers.
I’ll add support for floats later, however it requires that I use a custom PRNG (it’s either that or hacking my way through the current PRNG…)
Too bad theres no function overloading, it could come in handy on cases like this one for instance.