This is whats called a "pseudo random number generator". It uses a set seed to come up with numbers that look random but in truth can be predicted every time if you know what the seed is and what algorithm is used to generate these "random" numbers. Feel free to use for your own games and/or improve it.
The specific algorithm used is the Linear Congruential Generator(LCG), the same PRNG used for things like minecraft worlds. It should work for your games too!