Last active
December 27, 2018 07:41
-
-
Save akako/21f008e0e80d6389e73f32c9b6bfbfbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Test(string seed) | |
{ | |
var seedNum = 0; | |
foreach (var c in seed) | |
{ | |
seedNum += (int)c; | |
} | |
return new System.Random(seedNum); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Test(string seed, int floor) | |
{ | |
long randomSeed = 0; | |
foreach (var c in seed) | |
{ | |
randomSeed = (randomSeed + (int)c) * ((int)c + floor) % Int32.MaxValue; | |
} | |
var random = new System.Random((int)randomSeed); | |
random.Next(100) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment