I need some help with maths. I am generating a derived seed value from a parent seed value.
I need to derive a number y given a number x which follows the following rules.
x = math.random(1000, 9999)
- for a given x, y is constant. ie.
y = f(x)
- y doesnt necessarily follows x. ie y doesnt needs to grow when x grows and y doesnt needs to reduce when x reduces. eg. if x = 1234 and in the next iteration
x = 3456
then y also doesnt needs to grow. in fact y would better be a pseudo random number. - y also is in the range (1000, 9999)
Early on i went for the following function:
y = tonumber(string.reverse(x))
ie. if x = 1234
then y = 4321
However there is a direct correlation between the two numbers and my terrain is looking way too symmetric as a result.
Aucun commentaire:
Enregistrer un commentaire