I'm trying to write a program that mimics the way Minecraft turns strings into numbers to use them as seeds for world generation, but I just can't get it to work! The code I'm using is as follows:
0→num
For x,1,dim(seed)
ord(mid(seed,x,1))→c
num + c * 31^(dim(seed)-x)→num
EndFor
I've tried several +1 and -1 variations in the exponent, but none of them give the same number as MC does.
0→num
For x,1,dim(seed)
ord(mid(seed,x,1))→c
num + c * 31^(dim(seed)-x)→num
EndFor
I've tried several +1 and -1 variations in the exponent, but none of them give the same number as MC does.