mardi 26 septembre 2017

Get Static Random Value with two seed

How do to get the same number every time assuming i have two seed and i want to get a random value between 1-99.

In c# there is a System.Random function but it use next() which mean i can't guess what number that came out assuming i know both seed. Is there another function in c# that able to accomplish my goal?

int gameSeed = 123;

public void GenerateAgeList(){
    GenerateAge(1); //Always return for example 23
    GenerateAge(2); //Always return for example 34
    GenerateAge(1); //Since the popSeed is also one also return 23
    for(int i = 1; i<5 ; i++){
        GenerateAge(i);
    } // Always return for example 23,34,10,...
}

public int GenerateAge(int popSeed){
    return unknownFunction(gameSeed,popSeed,1,99));
}




Aucun commentaire:

Enregistrer un commentaire