samedi 19 décembre 2020

Code for reversing Linear Congruential Generator in python

index 0 of x is the seed, but what if, you want to know the index -1 of x.

I am making a game in python with pygame, and i require help, since i require to use that in world generation

Edit:

x is the random number, index 0 of x is seed

the LCG looks like this

x[i + 1] = (x[i] * mu + inc) % m

m is modulus

inc is increment

mu is multiplier




Aucun commentaire:

Enregistrer un commentaire