Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // The PRand script provides explicitly pseudo-random functions, intended to be used
- // in procedural generation.
- //
- //================================================================================
- // Functions
- int RNG_SEED_X = 1;
- int RNG_SEED_Y = 1;
- int RNG() {
- RNG_SEED_X = 36969 * (RNG_SEED_X & 65535) + (RNG_SEED_X >> 16);
- RNG_SEED_Y = 18000 * (RNG_SEED_Y & 65535) + (RNG_SEED_Y >> 16);
- return (RNG_SEED_X << 16) + (RNG_SEED_Y & 65535);
- }
- int PRandInt (int min, int max) {
- return AbsI(ModI(RNG(), max - min) + min);
- }
- fixed PRandFixed (fixed min, fixed max) {
- return AbsF(ModF(RNG(), max - min) + min);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement